Migrate Jira–ServiceNow Integration to OOB Jira Spoke with OAuth 2.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi ALL,
We are currently planning to transition our existing custom Jira–ServiceNow integration to the Out-of-the-Box (OOB) Jira Spoke (Integration Hub) and upgrade our authentication mechanism to OAuth 2.0.
I’d appreciate guidance from the community on a few specific points:
How should custom REST payloads or custom Jira fields be handled when OOB spoke actions don't cover specific requirements?
How can we best trigger these custom actions using OOB or custom Jira Spoke triggers?
Are there specific patterns, potential pitfalls, or architectural strategies we should follow for migrating from a legacy script-based integration to standard Integration Hub flows?
Could you share any official documentation, community articles, or learning paths that demonstrate end-to-end custom action/trigger setup for the Jira Spoke with OAuth 2.0?
Thanks in advance for your insights!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Revathi2410 ,
First thing to pin down is whether you're on Jira Cloud or Data Center, because it changes your auth options. The OAuth 2.0 setups ServiceNow documents for the Jira spoke are Cloud only: Authorization Code (a 3LO app in the Atlassian developer console) or Client Credentials (an OAuth credential on an Atlassian service account). For Server/Data Center the spoke docs only cover username/password or a personal access token.
On Cloud I'd go with Client Credentials and a service account. With Authorization Code the token is issued for whoever clicked Get OAuth Token, so everything the spoke does shows up in Jira as that person and the integration depends on their access. If you do end up on Authorization Code, have a dedicated integration account do the authorising, not a real employee. Either way the connection URL is https://api.atlassian.com/ex/jira/<cloud-id>, not yoursite.atlassian.net, which is easy to miss if you're copying endpoints out of the old scripts. And if your current integration authenticates with an API token, that's another reason to move: the current docs flag the API token options as not compliant with Atlassian's security requirements.
For custom fields, check what the spoke can already do before writing a custom action. Look up Fields gives you the customfield_xxxxx ID for a field label, and Get Creatable Fields / Get Editable Fields show what a project or issue will accept. Most errors here come from value shape rather than missing support. A select list wants {"value": "Option A"} or {"id": "10001"}, not a bare string or number. Also, the spoke is built on REST API v2 (there's an API Version attribute on the connection, default 2). If your current scripts call v3, description and comment bodies are ADF JSON there and plain text in v2, so those payloads won't carry over as they are.
When the spoke really doesn't cover something, build a custom action in your own scoped app and in the REST step choose Use Connection Alias with the spoke's Jira alias. That way your custom actions share the same OAuth credential and there's nothing extra to maintain. Don't edit the spoke's own actions; copy one if you want a starting point, since it's a Store app and your changes will fight with spoke upgrades. If you need more than one Jira environment, add child aliases under the Jira alias rather than creating separate ones.
On triggers, your custom actions don't need a trigger of their own. They're just steps in a flow, so the real question is how the Jira event gets into the flow. The spoke has two separate ways to do that. The newer one is spoke triggers (Issue Created/Updated/Assigned/Deleted, plus comment, sprint and board events), which need Jira spoke 5.0+ on Xanadu or later:
- In Workflow Studio go to the Integrations tab, switch to Inbound connections, open the Jira Spoke endpoint and configure Jira External Trigger.
- Select the user that can trigger the endpoint (a dedicated integration user with only the roles your flows need, not admin), activate it and copy the generated URL.
- In Jira, under Settings > System > WebHooks, create a webhook with that URL and the events you want.
The older route is Jira Webhook Registries plus Jira WebHook Routing Policies, which call a copy of the Process Jira Webhooks subflow. The two use different endpoints, so a Jira webhook pointed at the registry callback URL won't start a flow that uses a spoke trigger. That mix-up is a common reason for "my Jira trigger never fires" posts. For new work I'd use the spoke triggers and keep the same events off the old path.
Plan for loops from day one. Issue Updated also fires for changes ServiceNow made through the spoke, so the inbound flow should ignore events raised by your integration account. The outbound side should likewise ignore record updates made by the inbound user.
For the migration itself, inventory everything the old integration does (business rules, script includes, scheduled jobs, scripted REST endpoints) and map each piece to a spoke action, spoke trigger or custom action. Keep using whatever field holds the Jira key today so records that are already linked keep syncing. I wouldn't run old and new against the same Jira project at the same time, because you'll get duplicate issues and comments. Build and test in sub-prod against a Jira sandbox, then cut over in one change: deactivate the old scripts and Jira webhooks, and activate the flows.
A few other things to budget for:
- Calls made by spoke actions in flows count as Integration Hub transactions, which your scripted RESTMessageV2 calls may not have done. Check your entitlement and watch the IH usage dashboard while testing at realistic volume.
- Connection and credential records don't travel with the flow (the alias does), so the OAuth app registry, credential and connection have to be set up in each instance.
- If the old integration manages webhooks or users, note that Update Webhook, Create User and Remove User aren't supported with OAuth 2.0.
Docs I'd work from:
Jira spoke: https://www.servicenow.com/docs/r/australia/integrate-applications/integration-hub/jira-spoke-v3-0-2...
Jira Cloud setup, both OAuth options: https://www.servicenow.com/docs/r/australia/integrate-applications/integration-hub/setup-jira-spk-op...
Spoke trigger setup: https://www.servicenow.com/docs/r/australia/integrate-applications/integration-hub/jira-ext-trigger....
Community guide to running the spoke under a service identity, worth reading before you pick a grant type: https://www.servicenow.com/community/developer-forum/the-missing-jira-spoke-implementation-guide-aus...
Atlassian service account OAuth credentials: https://support.atlassian.com/user-management/docs/create-oauth-2-0-credential-for-service-accounts/
Sources: