Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Jira

Articles

SHARE

Integrate Jira and ServiceNow Without Code

Patrick Li

August 1, 2024

10

min read

In recent blog posts, we have looked at REST API, webhook, and Jira automation, tools that can help integrate and automate processes between different applications and systems. One popular integration is between Jira and ServiceNow. Many organizations have made investments in both tools. Support teams often live in ServiceNow, while the engineering teams live in Jira. Integrating the two systems is often desirable to improve inter-departmental collaboration and reduce double data entry.

In this blog, we will explore how you can build such an integration using the tools mentioned earlier without writing a single line of code. We will look at two integration points:

  1. Create a ServiceNow ticket (incident) from a Jira issue.
  2. Automatically update a ServiceNow ticket (incident) referenced in a Jira issue whenever the issue is updated.

Enable API Key in ServiceNow

Since we will be using ServiceNow’s REST API, we will need to have a way to authenticate our requests to these APIs. ServiceNow provides several authentication mechanisms to use its REST API, such as Basic authentication with username and password, using an API Key, and more. In this integration, we will be using the API Key option, as it offers two distinct advantages:

1. No username and password would be exposed.

2. It is relatively easier to implement.

The API we will be using is the Table API.

Create authentication profile

You must enable the API Key in ServiceNow to use it. The first step is to set up a new authentication profile.

  1. Go to All → System Web Services → API Access Policies → Inbound Authentication Profile.

Navigating to "Inbound Authentication Profile"

  1. Click on the “New” button and then select the “Create API Key authentication profiles” option to create a new profile.
  2. Enter a name for the new profile, such as API Key Profile.
  3. Select and add “x-sn-apikey” for both “Auth Header” and “Query Parameter” options for the Auth Parameters field.
  4. Click the “Submit” button to create the profile.

Create access policy

The next step is to create a new REST API Access Policy.

  1. Go to All → System Web Services → API Access Policies → REST API Access Policy.
  2. We must add two policies, one for “POST” and one for “PUT,” to the Table API. 

Adding two policies

You can simplify this by combining both policies into a single policy and applying it to ALL methods (including both POST and PUT). The main key here is to add our API Key Profile created from the previous step to these policies:

Generate API key

Now, with all the authentication and access policies set up, we can generate the API key we can use to make authenticated REST API calls:

  1. Go to All → System Web Services → API Access Policies → REST API Key.

Navigating to "REST API Key"

  1. Click on the” New” button to create a new API key.
  2. Enter a meaningful name for the API key, such as “Jira API Key.” 
  3. Select a user this API key will be associated with, such as a service account for Jira.
  4. Click the “Submit” button to create the API key.

Once the API key is created, you can click on it and then the Lock icon to reveal the actual token. Copy the token and save it for future use.

Experience the Ease & Confidence of NetSuite Customizations with Salto

Automate the way you migrate Jira configurations from sandbox to production

STAY UP TO DATE

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Set up Automation in Jira

Now that we have our API Key for ServiceNow, we can start configuring our automation rules in Jira to make API calls to ServiceNow. But before we do that, make sure you add two new simple text custom fields to Jira, as we will be using them to store references to ServiceNow incidents we create:

  1. ServiceNow Number - this will store the human-readable number for the incident.
  2. Service Sys ID - this is the system ID for the incident.

You can name them whatever you like but do make sure to make the appropriate adjustments in later steps when these fields are referenced.

The first automation rule we will add is to allow us to manually create a ServiceNow incident from a Jira issue:

  1. Browse to the Jira project you want to sync data with ServiceNow.
  2. Go to Project Settings → Automation.
  3. Click on “Create rule” to create our first automation rule.
  4. First, we need to select how to trigger our automation rule. In this example, we will manually create a ServiceNow incident from a Jira issue, so select the” Manual trigger from issue” trigger.

Selecting a trigger

  1. With our trigger added, we need to add an action. Since we will make a REST API call to ServiceNow, select the “Send web request” action.

Adding an action

We are using Jira’s smart value feature, so when the automation rule runs, it will send the current issue’s summary and description value.

6. Once we have called the REST API, we want to wait for a response and update our Jira issue to store the ID for the ServiceNow request. Select and add the “Edit issue” action to our rule. 

Adding another action

With our first automation rule in place, you should see it appear in the “Actions” menu. Clicking on that will trigger our rule, and a new ServiceNow incident will be created based on the data from Jira, such as the Summary and Description fields. You should also see the “ServiceNow Number” and “ServiceNow Sys ID” fields getting populated with data from the response of our API call.

Pushing to ServiceNow

Now that we have created a ServiceNow incident from our Jira issue and have a reference ID for the incident in the ServiceNow Sys ID field, we can expand on this integration by adding automated processes, such as updating the incident whenever the issue is edited.

  1. Add another automation rule, but this time, use the “Issue updated” trigger. This will ensure that the rule triggers every time an issue is updated.
  2. Add an Issue field condition to check that the “ServiceNow Sys ID” field is not empty. This ensures that our rule will continue to execute only if the Jira issue has a value for the field, i.e., it has a reference to a ServiceNow incident for it to sync with.

Adding a condition

  1. Add a “Send web request” action to make another REST API call to update the ServiceNow incident referenced in the ServiceNow Sys ID field with the latest updates from Jira, keeping both systems in sync.

We are again using Jira’s smart value feature to retrieve the value in the ServiceNow Sys ID field for the current issue and add it to the REST API URL so we can update the correct incident.

With the second automation rule in place, whenever we update a Jira issue, the referenced ServiceNow incident will be automatically updated as well.

STAY UP TO DATE

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Summary

We have looked at how to build an integration using REST API, automation, and Jira’s smart value features. Our current integration lets users manually sync a Jira issue and turn it into an incident in ServiceNow. Once synced, we can keep them synced with the Issue edited trigger.

We can easily expand on this by changing the manual trigger so the initial sync can also be automated. We can also sync comments over to ServiceNow by creating a new automation and using the Issue commented trigger. As we can see, the possibilities are limitless.

WRITTEN BY OUR EXPERT

Patrick Li

Atlassian Expert & Consultant

Patrick Li has over 15 years of experience working with Atlassian tools. He has developed many custom apps and integrations to help extend the capabilities of Jira and Confluence beyond what comes out of the box. He has also written and published over 10 books on how to best use Jira.

Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Jira

Jira

SHARE

Integrate Jira and ServiceNow Without Code

Patrick Li

August 1, 2024

10

min read

In recent blog posts, we have looked at REST API, webhook, and Jira automation, tools that can help integrate and automate processes between different applications and systems. One popular integration is between Jira and ServiceNow. Many organizations have made investments in both tools. Support teams often live in ServiceNow, while the engineering teams live in Jira. Integrating the two systems is often desirable to improve inter-departmental collaboration and reduce double data entry.

In this blog, we will explore how you can build such an integration using the tools mentioned earlier without writing a single line of code. We will look at two integration points:

  1. Create a ServiceNow ticket (incident) from a Jira issue.
  2. Automatically update a ServiceNow ticket (incident) referenced in a Jira issue whenever the issue is updated.

Enable API Key in ServiceNow

Since we will be using ServiceNow’s REST API, we will need to have a way to authenticate our requests to these APIs. ServiceNow provides several authentication mechanisms to use its REST API, such as Basic authentication with username and password, using an API Key, and more. In this integration, we will be using the API Key option, as it offers two distinct advantages:

1. No username and password would be exposed.

2. It is relatively easier to implement.

The API we will be using is the Table API.

Create authentication profile

You must enable the API Key in ServiceNow to use it. The first step is to set up a new authentication profile.

  1. Go to All → System Web Services → API Access Policies → Inbound Authentication Profile.

Navigating to "Inbound Authentication Profile"

  1. Click on the “New” button and then select the “Create API Key authentication profiles” option to create a new profile.
  2. Enter a name for the new profile, such as API Key Profile.
  3. Select and add “x-sn-apikey” for both “Auth Header” and “Query Parameter” options for the Auth Parameters field.
  4. Click the “Submit” button to create the profile.

Create access policy

The next step is to create a new REST API Access Policy.

  1. Go to All → System Web Services → API Access Policies → REST API Access Policy.
  2. We must add two policies, one for “POST” and one for “PUT,” to the Table API. 

Adding two policies

You can simplify this by combining both policies into a single policy and applying it to ALL methods (including both POST and PUT). The main key here is to add our API Key Profile created from the previous step to these policies:

Generate API key

Now, with all the authentication and access policies set up, we can generate the API key we can use to make authenticated REST API calls:

  1. Go to All → System Web Services → API Access Policies → REST API Key.

Navigating to "REST API Key"

  1. Click on the” New” button to create a new API key.
  2. Enter a meaningful name for the API key, such as “Jira API Key.” 
  3. Select a user this API key will be associated with, such as a service account for Jira.
  4. Click the “Submit” button to create the API key.

Once the API key is created, you can click on it and then the Lock icon to reveal the actual token. Copy the token and save it for future use.

What if Zendesk was 4x less work?

Request a Demo Get started with Salto

Set up Automation in Jira

Now that we have our API Key for ServiceNow, we can start configuring our automation rules in Jira to make API calls to ServiceNow. But before we do that, make sure you add two new simple text custom fields to Jira, as we will be using them to store references to ServiceNow incidents we create:

  1. ServiceNow Number - this will store the human-readable number for the incident.
  2. Service Sys ID - this is the system ID for the incident.

You can name them whatever you like but do make sure to make the appropriate adjustments in later steps when these fields are referenced.

The first automation rule we will add is to allow us to manually create a ServiceNow incident from a Jira issue:

  1. Browse to the Jira project you want to sync data with ServiceNow.
  2. Go to Project Settings → Automation.
  3. Click on “Create rule” to create our first automation rule.
  4. First, we need to select how to trigger our automation rule. In this example, we will manually create a ServiceNow incident from a Jira issue, so select the” Manual trigger from issue” trigger.

Selecting a trigger

  1. With our trigger added, we need to add an action. Since we will make a REST API call to ServiceNow, select the “Send web request” action.

Adding an action

We are using Jira’s smart value feature, so when the automation rule runs, it will send the current issue’s summary and description value.

6. Once we have called the REST API, we want to wait for a response and update our Jira issue to store the ID for the ServiceNow request. Select and add the “Edit issue” action to our rule. 

Adding another action

With our first automation rule in place, you should see it appear in the “Actions” menu. Clicking on that will trigger our rule, and a new ServiceNow incident will be created based on the data from Jira, such as the Summary and Description fields. You should also see the “ServiceNow Number” and “ServiceNow Sys ID” fields getting populated with data from the response of our API call.

Pushing to ServiceNow

Now that we have created a ServiceNow incident from our Jira issue and have a reference ID for the incident in the ServiceNow Sys ID field, we can expand on this integration by adding automated processes, such as updating the incident whenever the issue is edited.

  1. Add another automation rule, but this time, use the “Issue updated” trigger. This will ensure that the rule triggers every time an issue is updated.
  2. Add an Issue field condition to check that the “ServiceNow Sys ID” field is not empty. This ensures that our rule will continue to execute only if the Jira issue has a value for the field, i.e., it has a reference to a ServiceNow incident for it to sync with.

Adding a condition

  1. Add a “Send web request” action to make another REST API call to update the ServiceNow incident referenced in the ServiceNow Sys ID field with the latest updates from Jira, keeping both systems in sync.

We are again using Jira’s smart value feature to retrieve the value in the ServiceNow Sys ID field for the current issue and add it to the REST API URL so we can update the correct incident.

With the second automation rule in place, whenever we update a Jira issue, the referenced ServiceNow incident will be automatically updated as well.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Summary

We have looked at how to build an integration using REST API, automation, and Jira’s smart value features. Our current integration lets users manually sync a Jira issue and turn it into an incident in ServiceNow. Once synced, we can keep them synced with the Issue edited trigger.

We can easily expand on this by changing the manual trigger so the initial sync can also be automated. We can also sync comments over to ServiceNow by creating a new automation and using the Issue commented trigger. As we can see, the possibilities are limitless.

WRITTEN BY OUR EXPERT

Patrick Li

Atlassian Expert & Consultant

Patrick Li has over 15 years of experience working with Atlassian tools. He has developed many custom apps and integrations to help extend the capabilities of Jira and Confluence beyond what comes out of the box. He has also written and published over 10 books on how to best use Jira.