{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21526,"path":"integrate-applications/integration-hub/setup-jira302-webhooks.md","title":"Set up a bi-directional webhook for the Jira spoke","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up a bi-directional webhook for the Jira spoke\n\nConfigure a webhook to subscribe to Jira with a ServiceNow callback URL.\n\n## Before you begin\n\n-   Request an Integration Hub subscription\n-   Activate the Jira spoke\n-   Role required: admin\n\n## Create a token\n\nCreate a token to embed in the Jira webhook URL.\n\n### Before you begin\n\nRole required: admin\n\n### Procedure\n\n1.  In the navigation filter, enter `token_verification.list`.\n\n    The system displays records in the Token Verifications table.\n\n2.  Click **New**.\n\n3.  On the form, fill the fields.\n\n    |Field|Description|\n    |-----|-----------|\n    |Name|Unique name to identify the token. For example, `Jira token`.|\n    |Description|Description of the token.|\n    |Token|Authentication token. This token is used to authenticate incoming webhook requests.|\n\n\n### Result\n\nThe token created is used to authenticate incoming webhook requests.\n\n## Register a Jira webhook in ServiceNow\n\nRegister a Jira webhook in ServiceNow to notify the ServiceNow app when certain events occur in Jira.\n\n### Before you begin\n\nRole required: admin\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Jira Webhooks** &gt; **Jira Webhook Registries**.\n\n2.  Click **New**.\n\n3.  On the form, fill in the fields.\n\n    |Field|Description|\n    |-----|-----------|\n    |Name|Unique name to identify the record. For example, `Jira webhook`.|\n    |Description|Description of the record.|\n    |Token|Authentication token. This token is used to authenticate incoming webhook requests.|\n    |Path|Jira webhook path. By default, this path is set to `api/sn_jira_spoke/jira_webhook_callbacks/wh_entry`.|\n\n4.  Right-click the form header and click **Save**.\n\n5.  Choose how you want to authenticate callback requests and select one of the either options.\n\n    |Callback URL Type|Description|\n    |-----------------|-----------|\n    |Token-based Callback URL|Uses a static token in the URL for simple authentication.|\n    |HMAC-based Callback URL|Uses Hash-based Message Authentication Code \\(HMAC\\) for enhanced security and tamper-proof authentication.|\n\n    The system displays either the token‑based callback URL or the HMAC‑based callback URL based on your selection.\n\n6.  Copy and record the webhook callback URL.\n\n\n### Result\n\nThe Jira webhook is registered in your ServiceNow instance.\n\n## Add a callback URL in Jira\n\nProvide a webhook callback URL in yourJira Atlassian account to create a webhook.\n\n### Before you begin\n\nRole required: admin\n\n### Procedure\n\n1.  Log in to your Jira Atlassian account.\n\n2.  Create a webhook in your Atlassian account.\n\n3.  Enter the webhook callback URL in the **URL** field.\n\n    See the [Atlassian Developer](https://developer.atlassian.com/docs/) portal documentation for instructions on creating a webhook.\n\n    **Note:** If you select an HMAC-based callback URL while [registering a webhook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-jira302-webhooks.md), enter the [secret token created](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-jira302-webhooks.md) from your ServiceNow instance in the webhook’s **Secret** field.\n\n    \\[Omitted image \"jira-spoke-webhook-secret.png\"\\] Alt text: Jira spoke webhook creation in Jira portal.\n\n4.  Select the related events that should trigger the webhook.\n\n\n### Result\n\nThe callback URL is added in your Jira Atlassian account. You can create routing policies and subflows as per your requirement. See [Customize a bi-directional webhook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-jira302-webhooks.md) for information regarding the creation of new routing policies and subflows.\n\n## Customize a bi-directional webhook\n\nCreate a webhook routing policy and subflow as per your requirement.\n\n### Before you begin\n\nRole required: admin\n\n### About this task\n\nThe default routing policy in the Jira WebHook Routing Policies module triggers the Process Jira Webhooks subflow and notifies the ServiceNow app when certain events occur in Jira. See [Jira Spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/jira-spoke-v3-0-2.md) for information about the fields that the default routing policy and subflows support. To use any other fields in your custom subflow and customize conditions in the routing policy, perform these steps.\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Flow Designer** &gt; **Designer**.\n\n2.  Click **Subflows**.\n\n3.  Create a copy of the default subflow, Process Jira Webhooks.\n\n4.  Customize the subflow as per your requirement and publish it. See [Building subflows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/subflows.md) for more information about creating and using subflows and [Jira Spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/jira-spoke-v3-0-2.md) for information about the fields that the default routing policy and subflows support.\n\n5.  Navigate to **Jira Webhooks** &gt; **Jira WebHook Routing Policies**.\n\n6.  Click **New**.\n\n7.  On the form, fill in the fields.\n\n<table id=\"table_awj_xgv_z3b\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nLabel\n\n</td><td>\n\nUnique label to identify the routing policy.\n\n</td></tr><tr><td>\n\nDefault answer\n\n</td><td>\n\nOption to specify if this is the default answer. The default answer is applicable when the conditions are not met.1.  Click the lookup icon \\(\\[Omitted image \"lookup-icon.png\"\\] Alt text: Lookup icon\\).\n2.  Select the required subflow from the Document list.\n\n**Note:** Ensure that the **Table name** is `Flow [sys_hub_flow]`.\n\n</td></tr><tr><td>\n\nCondition\n\n</td><td>\n\nConditions to be met when the required events occur in Jira. See [Jira webhooks](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/jira-spoke-v3-0-2.md) for information about the supported fields.\n\n</td></tr><tr><td>\n\nAnswer\n\n</td><td>\n\nSubflow that must be triggered when the specified conditions are met.\n\n</td></tr></tbody>\n</table>8.  Click **Submit**.\n\n    **Note:** These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.\n\n\n### Result\n\nThe routing policy and subflow are created.\n\n"}}