---
title: "Insert a Jira issue action"
canonical: "https://support.appfire.com/space/EIFJC/33850081/Insert%20a%20Jira%20issue%20action"
format: markdown
---
> Macro (aura-html)

The Insert a Jira issue action lets you create an issue in Jira, and, if the option to generate subtasks in Jira is enabled, you can create a subtask. This documentation provides step-by-step instructions on how to configure this action within Easy Integration.

## How to configure the Insert a Jira issue action

The Insert a Jira Issue action in Listeners can be accessed within Easy Integration's admin UI. Follow these steps to configure:

1. Navigate to Jira's top menu, and click **Apps**.
2. Select **Manage your apps**.
3. In the sidebar, locate and click **Easy Integrations configuration**.
4. Select **Listeners** from the app’s top menu.
5. Configure the listener according to your requirements. For more information on that, refer to [this documentation](https://appfire.atlassian.net/wiki/spaces/EIFJC/pages/10125382/Listeners#How-to-Create-a-New-Listener).
6. In the *Actions* section of the listener configuration, click** Insert a Jira Issue**.

Here's how to set up the Insert a Jira issue action:

![image](media://6117ed71-d094-46a6-b1c7-f5276cb40f40)

7. **Action name –** Give a descriptive name to easily identify this action.
8. **Condition – **Enable or disable the condition.  
When enabled, provide a JavaScript condition for the listener. The action will execute only if the script returns true. You can refer to [Context variables, Scripts, and Events](https://appfire.atlassian.net/wiki/spaces/EIFJC/pages/10125347) for more details. For example:  
`return startsWith(data.event.issue.fields.summary, 'Sultans of Swing');`
9. **Subtask – **Enable this option to create the issue as a subtask.
  - **Custom parent issue key:** Unchecked: Event's issue / Checked: Custom issue
  - **Issue ID or Key script: **Write a JavaScript script that returns an Issue ID or key. Event data or previous action data can be used in the script. For example: `return data.apiData.api1.responseBody.issueId;`
10. **Project –** Select a project that the issue will be added to.
11. **Issue Type –** Select an issue type for the issue.
12. **Summary Text script – **Write a JavaScript script that returns a text for the summary. Event data or previous action data can be used in the script. For example:  
`return data.event.issue.fields.summary;`
13. **Issue fields – **Select which fields to update, or click Add field to create new ones.
  - **Field**: Choose the field to be updated.
  - **Field script**: This is the script for the field value. Event and previous Action data are available.
  - **Custom shape for field**: Check for the custom object field. Not all fields require a string. See the [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put) for more information.
  - **Custom shape for field**: Write the JSON for the custom shape. The `{{fieldValue}}` variable (result of Field script) is available.
14. Click **Save**, and then save your listener configuration as well.

That’s it! You have successfully configured the Insert a Jira Issue action in Easy Integrations. For further insights, check out the following example:

### Example 1: Send an email

Here's an example that adds an issue as a subtask, with the parent issue key fetched from the event's issue and the summary text coming from the first action.

*Note: This is a sample use case and can be customized to suit your integration needs.*

<details>
<summary>Example:</summary>

![image](media://d5917845-8354-4770-aa22-e94a5c9065e0)
</details>