---
title: "Action: create a Jira ticket"
description: "Create a Jira ticket automatically when an event happens in Guardian."
product: "Guardian"
edition: "Classic"
type: "workflow"
url: "https://docs.cloudhouse.com/guardian/classic/control/events/actions/jira-ticket/"
---
# Action: create a Jira ticket

Create a Jira ticket automatically when an event happens in Guardian. For example, with a Jira integration, you could automatically create a ticket on a Jira board when a scan fails. This is useful if your team uses Jira to track issues that need to be addressed or triaged. You can configure this as an **Action** that automatically creates a Jira ticket every time a scan or policy fails in your Guardian instance.

Applies to: `Guardian Classic`

!!! note

    The following process assumes you have a Jira integration already configured in Guardian. For more information, see [Jira Integration](https://docs.cloudhouse.com/guardian/classic/control/integrations/jira-integration/index.md).

![Screenshot showing the Add Action page in Guardian for creating a Jira Ticket](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/jira-ticket.png)

!!! tip

    For an overview of actions in Guardian, including more options available to choose from, see [Actions](https://docs.cloudhouse.com/guardian/classic/control/events/actions/actions/index.md).

## Action settings

When configuring a **Create a Jira Ticket** action, the following settings are presented:

**Action Name** field
:   A unique name for the action. This name is how you will identify this action among all others configured in your Guardian instance, so ensure it is descriptive. For example, 'New Policy Failure Jira Ticket' and not simply 'Failed Policy'.

**Summary** field
:   A brief summary of the event that triggered the action. What you enter here will be used in the **Summary** field of the resulting Jira ticket.

    To make your summaries dynamic, you can include variables in this field. Variables are pieces of text that Guardian will replace with relevant data. For example, you could use the variable `{{ policy }}` to indicate which specific policy triggered the action. When a Jira ticket is created, you will see that policy in place of the variable.

    !!! note

        For more information on creating and using variables, see [Variables](https://docs.cloudhouse.com/guardian/classic/control/variables/variables/index.md).

**Description** field
:   A detailed overview of the event that triggered the action. What you enter here will be used in the **Description** field of the resulting Jira ticket.

    As in the **Summary** field, you can use [variables](https://docs.cloudhouse.com/guardian/classic/control/variables/variables/index.md) here to make your descriptions dynamic.

**Combine** drop-down list
:   The option to group similar Jira tickets together rather than creating a new ticket for each triggering event.

    Guardian is able to use the **Summary** field to recognise if two actions will result in the same Jira ticket being created. If you choose to combine tickets, only one ticket will be created for each unique **Summary**. All subsequent tickets resulting in the same **Summary** will either be added as a comment or a label to the original ticket.

    !!! note

        Guardian will only combine tickets if the original ticket is still "open" in Jira. Guardian will not combine new tickets with tickets that have been closed.

    This drop-down offers the following options:

    - **No** – A new Jira ticket is created each time the action is triggered. No combining occurs.
    - **Yes - Add comment** – Combines new tickets with an existing ticket that has the same Summary by adding a comment to the existing ticket. If selected, the **Comment (for combine)** field is displayed.
    - **Yes - Add label** – Combines new tickets with an existing ticket that has the same Summary by adding a label to the existing ticket. If selected, the **Label (for combine)** field is displayed.

**Comment (for combine)** field (Optional)
:   The comment to add to existing Jira tickets when combining of similar tickets occurs.

    !!! note

        This field is only displayed if you selected 'Yes - Add comment' from the Combine drop-down list.

**Label (for combine)** field
:   The label to add to existing Jira tickets when combining of similar tickets occurs.

    As in the **Summary** field, you can use [Variables](https://docs.cloudhouse.com/guardian/classic/control/variables/variables/index.md) here to make your descriptions dynamic.

    !!! note

        This field is only displayed if you selected 'Yes - Add label' option from the Combine drop-down list.

**Jira Integration** drop-down list
:   A list of all Jira integrations configured in your Guardian instance.

    When configuring a Jira integration, you designate a specific Jira URL and user for that integration. These are used to identify each Jira integration. From the drop-down list, select the Jira integration you want to use for this action.

    Once you make a selection here, the Jira Project and Ticket Priority drop-down lists appear with the selected integration's available options.

**Jira Project** drop-down list
:   A list of the Jira projects available as part of the selected integration. From the drop-down, select the project where you want your tickets to be created.

    Once you make a selection here, the **Issue Type** drop-down list appears with the selected project's available Jira issue types.

**Ticket Priority** drop-down list
:   A list of the priority statuses that can be assigned to each Jira ticket. From the drop-down, select the priority you want to assign to tickets created by this action.

**Issue Type** drop-down list
:   A list of the issue types that can be assigned to each Jira ticket in your selected project. From the drop-down, select the issue type you want to assign to tickets created by this action.

    !!! note

        This option is only displayed if you selected an project from the Jira Project drop-down list.

**Computed Status** field (optional)
:   The status in your Jira project you want to apply to tickets created by this action. For example, these tickets can be added directly to your Jira Backlog or to another status in your project like In-Progress. To set a status for your tickets, use the following syntax in this field: `{% if true %}Backlog{% endif %}`. In this expression, replace `Backlog` with the status from your Jira project you want to assign to new tickets.

    If left blank, new tickets are automatically sent to your Jira Backlog.

**Label** field (optional)
:   A label to apply to new Jira tickets. If left blank, no label is applied.

    As in the **Summary** field, you can use [variables](https://docs.cloudhouse.com/guardian/classic/control/variables/variables/index.md) here to make your descriptions dynamic.

**Other Fields** text box (optional)
:   Data you wish to use to populate any other fields relevant to your Jira tickets. You can use JSON in this text box to set the values in fields not present when configuring this action. For example, you could give each new ticket a default assignee with the following:

    ```
    {     "fields":{         "assignee": "Name"     } }
    ```

    In the above example, you would replace `Name` with the name of your desired assignee. Replicate this format on additional rows within the JSON body for any other fields you wish to populate.

These settings are configured when adding a new action, and they can also be edited at any time through the **Actions** tab (**Control** > **Events** > **Action**). To edit an action from the **Actions** tab, click the **Ellipsis** (![Ellipses](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/buttons/ellipses.png)) and select **Edit**. Once you have made your edits, click **Done** to save them.

## Add a create a Jira ticket action

You can add a new **Create a Jira Ticket Action** action from any saved view in your Guardian instance. Each saved view represents a specific event determined using a query on the **Events** page. The saved view you select during this configuration determines the corresponding event that triggers your new action. For more information, see [Saved Views](https://docs.cloudhouse.com/guardian/classic/control/events/events/index.md#saved-views).

To add a Create a Jira Ticket action, complete the following process:

!!! tip

    For help completing any of the following fields, refer to their respective descriptions in the Action Settings table above.

1. Navigate to the **Events** tab (**Control** > **Events**).
2. Click the **Saved Views** button at the top of the page. The Saved Views side panel is displayed.

    ![Screenshot showing the Guardian Events page with a border around the Saved Views button.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/add-action-01.png)

3. Select the event you want to trigger your new action. The saved view for that event is displayed.
4. Click the **Actions** tab to display all existing actions configured for this event.
5. Click the **Add Action** button. The **Add New Action** page is displayed.

    ![Screenshot showing the Guardian Events page with a border around the Actinos tab and the Add Action button.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/add-action-02.png)

6. Click **Create a Jira Ticket**. The required fields are displayed.
7. Enter an **Action Name**.
8. Enter a **Summary**.
9. Enter a **Description**.
10. From the **Combine** drop-down, select whether you want to combine similar Jira tickets. Then, enter either a **Comment** or a **Label**, depending on your selection.
11. Select a **Jira Integration**. Then, select a **Jira Project**, **Ticket Priority**, and **Issue Type**.
12. (Optional) Enter a **Computed Status**.
13. (Optional) Enter a **Label**.
14. (Optional) In **Other Fields**, enter a JSON body to define additional fields in your new Jira tickets.
15. Click **Done**.

Now, a confirmation dialog is displayed and you are redirected to the **Actions** tab for your selected saved view. Here, you can view your new action. To disable, edit, or test the action, click the **Ellipsis** (![Ellipses](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/buttons/ellipses.png)) and select the appropriate option.
