{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":19795,"path":"impact/configure-jira-integration-options.md","title":"Configure Jira user story integration","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure Jira user story integration\n\nConfigure the Jira user story integration to create work items in a Jira project directly from Scan Engine finding records.\n\n## Before you begin\n\nGather the following from your Jira environment:\n\n-   Jira Project Key\n-   Work item type\n-   Domain name: the subdomain of your Jira URL \\(for example, `companyname` from `companyname.atlassian.net/jira`\\)\n\nRole required: Scan Engine Admin \\(sn\\_se.scan\\_engine\\_admin\\)\n\n## Procedure\n\n1.  Generate a Jira API token\n2.  Navigate to [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens).\n\n3.  Select **Create API Token**, enter a name, and copy the token.\n\n4.  Configure the integration\n5.  Navigate to `sys_auth_profile_basic.list` and select **New**.\n\n    Create one basic auth record per user who will create Jira work items. Set **Username** to the user's Jira email address and paste the API token in **Password**.\n\n6.  Navigate to **ALL** &gt; **Impact** &gt; **Configuration** &gt; **Scan Engine Properties** and select the **User Story Integration** properties tab.\n\n7.  Set **Integration Type** to `Jira` and populate the following fields: **Project key**, **Domain name**, **Work item type**.\n\n8.  Select **Update**.\n\n\n**Parent Topic:**[User story integration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/impact/user-story-integration-properties.md)\n\n## Jira integration script leading practices\n\nThe following leading practices are guidelines for creating Jira integration scripts.\n\n### Script variables\n\nThe Jira field mapping script runs on the ServiceNow instance at the time a work item is created. Use the following variables to populate Jira fields from finding data.\n\n|Variable|Description|\n|--------|-----------|\n|`payload`|The field mapping object sent to your Jira project. Set properties on this object to populate Jira fields.|\n|`grFinding`|GlideRecord of the finding. Use this to read finding data for field mapping.|\n|`workItemType`|The work item type selected for this integration.|\n|`Key`|The Jira project key configured for this integration.|\n\n### Leading practices\n\n-   **Map finding fields to Jira fields via payload**\n\n    Set properties on the `payload` object that correspond to your Jira project's field structure. Consult your Jira project configuration or the Jira REST API documentation to confirm the exact field keys expected by your project.\n\n-   **Use grFinding to pull finding context**\n\n    Access finding details using standard GlideRecord methods on `grFinding`. For example, use `grFinding.getValue('short_description')` to read the finding's short description and map it to a Jira summary field.\n\n-   **Use Key and workItemType for dynamic routing**\n\n    If your Jira environment has multiple projects or issue types, use `Key` and `workItemType` to conditionally route work items to the correct destination rather than hard-coding project keys in your script.\n\n-   **Enable ES12 mode for modern JavaScript**\n\n    To use modern JavaScript syntax, enable **ECMAScript 2021 \\(ES12\\) mode** in Scan Engine Properties before writing your mapping script.\n\n\n"}}