Set up the Jira spoke for Jira Cloud

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 6 minutes to read
  • Integrate your ServiceNow instance with the Jira Cloud instance to authenticate the requests from ServiceNow.

    Before you begin

    • Request an Integration Hub subscription
    • Activate the Jira spoke
    • Role required: admin

    About this task

    You can set up the Jira spoke for your Jira Cloud instance using basic authentication or OAuth authentication as per your requirement.

    Option 1: Using basic authentication

    Integrate the ServiceNow instance and Jira Cloud instance using an API key to authenticate ServiceNow requests.

    Before you begin

    Role required: admin.

    About this task

    You can integrate a ServiceNow instance with multiple Jira instances. For this integration, create a connection and credential alias record and a connection record for each Jira instance.

    Generate an Atlassian account API token

    Generate an Atlassian account API token to authenticate requests for spokes associated with an Atlassian account.

    Before you begin

    Make sure you have an Atlassian account.

    Role required: Atlassian administrator credentials

    About this task

    Complete these steps from your Atlassian account. See the Atlassian Developer portal documentation for instructions on generating your API token.
    Note:
    This procedure is applicable only if you're using the Jira Cloud subscription.

    Procedure

    1. Log in to Atlassian Start as an admin.
    2. Go to your account profile photo and select Account Settings.
      Atlassian Start page with the drop down menu of the selected profile picture. Account Settings option emphasized.
    3. Go to Security.
    4. In the API token section, select Create and manage API tokens.
    5. Select API token.
    6. On the form, provide an integration name for the Label field.
    7. Select Create.
      The Create an API token modal with the Create button emphasized.
      The API token is generated.
    8. Select Copy and record the value of the API token for later use.
      Confirmation modal of Your new API token with the Copy button emphasized.

    What to do next

    Use your API token to configure the cloud connection for a Jira or Jira Service Management spoke.

    Configure a connection for Jira spoke

    Add and configure a Jira connection to authenticate ServiceNow requests in Jira spoke.

    Before you begin

    Role required: admin

    Procedure

    1. Navigate to All > Process Automation > Workflow Studio.
    2. Click the Integrations tab.
    3. Under Connections, the Outbound connections are displayed by default.
    4. Locate the Jira connection alias and click View Details.
      • To configure the default connection and credential alias record that is shipped along with the Jira spoke, click View Details.
      • To manage more than one Jira spoke connection records, you should create a new child alias record by clicking Add Connection. For more information about using multiple connections, see Supporting multiple connections.
      If you are configuring the spoke for the first time, click Configure. Otherwise, click Edit.
    5. On the Connection form, fill in the fields.
      Field Description
      Connection Name Name to uniquely identify the connection. For example, Jira spoke cloud basic conn.
      Connection URL URL of your Jira instance in this format: https://<provider-domain-name>.atlassian.net.
      Server Type Select cloud.
      User name Enter the email address of the user.
      API Key Enter the API token you generated for your Jira Cloud instance.

      Connection configuration for Jira Cloud.

    6. Click Create Connection.

    Option 2: Using OAuth authentication

    Integrate the ServiceNow instance with your Jira account using OAuth to authenticate ServiceNow requests.

    Before you begin

    Role required: admin.

    Create an OAuth 2.0 integration in Jira account

    Create an OAuth 2.0 integration in Atlassian Developer console to authenticate the requests.

    Before you begin

    Role required: admin

    Procedure

    1. Log in to Atlassian Developer console as an admin.
    2. Under My apps, click Create and select OAuth 2.0 integration.
      Create an OAuth 2.0 integration.
    3. On the form, provide name of the integration and click Create.
      Provide integration name.
      The integration is created and the value of App ID is displayed.
    4. Click Authorization.
      1. Click Add under Action.
        Authorization to access APIs.
      2. In Callback URL, provide URL of your ServiceNow instance in this format: https://<ServiceNow-Instance-Name>.service-now.com/oauth_redirect.do.
        For example, https://example.service-now.com/oauth_redirect.do
        Add Callback URL.
      3. Click Save Changes.
    5. Click Settings.

      Under Authentication details, copy the values of Client ID and Client Secret.

      Copy the values of Client ID and Client Secret.
    6. Click Permissions.
      1. In Classic scopes, ensure that you select these scopes.
        • manage:jira-configuration
        • manage:jira-project
        • manage:jira-webhook
        • read:jira-work
        • read:jira-user
        • write:jira-work
      2. In Granular scopes, ensure that you select these scopes.
        • delete:sprint:jira-software
        • read:issue-details:jira
        • read:jql:jira
        • read:sprint:jira-software
        • write:sprint:jira-software
        • read:board-scope:jira-software
        • read:project:jira
      You can configure other scopes as per your requirement.

    Obtain the value of Cloud ID

    Obtain the value of Cloud ID of the Jira Cloud instance. This value is required during the configuration of the connection record in your ServiceNow instance.

    Before you begin

    Role required: admin

    Procedure

    1. Log in to Atlassian Administration as an admin.
    2. Click Select against the required organization.
    3. From the Jira Software product, click Manage product access.
      A new window is opened and the URL is in this format: https://admin.atlassian.com/s/<Cloud-ID>/apps.
    4. Copy the value of the Cloud ID for later use.

    Create an application registry in ServiceNow instance

    Use the information generate while creating the OAuth 2.0 integration to create an application registry record in your ServiceNow instance.

    Before you begin

    Role required: admin

    Procedure

    1. Navigate to All > System OAuth > Application Registry.
    2. Click New.
      The system displays the message What kind of OAuth application?.
    3. Select Connect to a third party OAuth Provider.
    4. On the form, fill these values.
      Field Description
      Name Name to identify the application registry record. For example, Jira cloud OAuth app registry.
      Client ID Client ID generated when the OAuth 2.0 integration was created in Atlassian Developer console.
      Client Secret Client secret generated when the OAuth 2.0 integration was created in Atlassian Developer console.
      Default Grant type Grant type used to establish the token. Select Authorization Code.
      Authorization URL OAuth authorization code endpoint. Enter: https://auth.atlassian.com/authorize.
      Token URL OAuth server token endpoint. Enter: https://auth.atlassian.com/oauth/token.
      Redirect URL OAuth callback endpoint. System generates the URL upon saving the application registry.
      Refresh Token URL URL to refresh a token. Enter: https://auth.atlassian.com/oauth/token.
      Note:
      This field is hidden in the form layout. Configure the form layout to show this field.
    5. In the OAuth Entity Scopes tab, create these entity scope records.
      Name OAuth scope
      delete:sprint:jira-software delete:sprint:jira-software
      manage:jira-configuration manage:jira-configuration
      manage:jira-project manage:jira-project
      manage:jira-webhook manage:jira-webhook
      offline_access offline_access
      read:issue-details:jira read:issue-details:jira
      read:jira-user read:jira-user
      read:jira-work read:jira-work
      read:jql:jira read:jql:jira
      read:sprint:jira-software read:sprint:jira-software
      write:jira-work write:jira-work
      write:sprint:jira-software write:sprint:jira-software
      read:board-scope:jira-software read:board-scope:jira-software
      read:project:jira read:project:jira
    6. Right-click the form header and click Save.
    7. Click the OAuth Entity Profiles tab and open the default record.
      For example, Jira OAuth Profile.
    8. In OAuth Entity Profile Scopes, ensure that the same entity scopes are provided.
      Else, insert new rows and select the same entity scopes you had earlier provided in the OAuth Entity Scopes tab.
    9. Right-click the form header and click Save.

    Create credential record for the Jira spoke

    Create a credential record for the Jira account. The Jira spoke connection and credential alias uses this credential to authorize actions.

    Before you begin

    Role required: admin

    Procedure

    1. Navigate to All > Connections & Credentials > Credentials.
    2. Click New.
      The system displays the message What type of Credentials would you like to create?
    3. Select OAuth 2.0 Credentials.
    4. On the form, fill these values.
      Field Description
      Name Name to identify the credential record for the Jira spoke. For example, Jira cloud OAuth credential.
      OAuth Entity Profile Default OAuth entity profile record created when the application registry record is configured.
    5. Click Submit.

    Create a connection record for the Jira spoke

    Create a connection record for the Jira account. The connection and credential alias uses this connection to perform actions in Jira.

    Before you begin

    Role required: admin.

    Procedure

    1. Navigate to All > Connections & Credentials > Connection & Credential Aliases.
    2. Open the alias record for Jira that shipped with the spoke.
    3. On the Connections tab, click New.
      The system displays a blank HTTP(s) Connection form.
    4. Enter these values and click Submit.
      Field Value required
      Name Enter any name to uniquely identify the connection record. For example, enter Jira cloud OAuth Connection.
      Credential Select the Credential record created for Jira. For example, select Jira cloud OAuth credential.
      Connection URL Enter the URL of your Jira instance in this format: https://api.atlassian.com/ex/jira/<Cloud-ID>.

      For information about obtaining the value of Cloud ID, see Obtain the value of Cloud ID.

    5. In the Attributes related list, provide these values.
      1. Enter the value 2 for api_version.
      2. Enter the value cloud for server_type.
      Attribute values.
    6. Click Submit.
    7. Navigate to All > Connections & Credentials > Credentials.
    8. Open the credential record you had created for the Jira spoke.
      For example, Jira OAuth credential.
    9. Click the Get OAuth Token related link.
      In a new window, system requests access to your Atlassian account.
    10. Click Accept.
      Access is granted to Atlassian account and a confirmation message is displayed in your ServiceNow instance that the refresh token is available.