REST Based ServiceNow / Jira Integration (PoC)

A few years ago, I developed a SOAP-based proof of concept integration between ServiceNow and JIRA. Recently, Atlassian announced that the JIRA SOAP web service interface was to be deprecated in favor of their newer REST-based API. Due to this change, I have had several customers approach me with the question, can ServiceNow integrate properly with JIRA now that Atlassian will be focusing on SOAP. The following PoC setup serves as an example of bi-directional communication between ServiceNow and JIRA.

Sample Business Case

Out of the box, this integration fulfills a scenario where there are two groups working tickets. One group is in the ServiceNow tool and the other is in JIRA.

The ServiceNow group creates a ticket that they know will be a JIRA issue to be worked by the secondary team. Once the ticket is created in ServiceNow, a corresponding ticket is created in JIRA. Comments can be exchanged between the two systems. Status changes can also occur between ServiceNow and Jira.

Integration Flow

This proof of concept demonstrates the ability of users in ServiceNow to create an Incident ticket that gets synchronized as a JIRA issue within a specified project. Only incidents marked as a “Jira Issue” will be synchronized.

When creating an incident in ServiceNow, the user must set the Category field to be “JIRA Issue”. From there, the Subcategory field will be populated with supported types of JIRA Issues. The user will select the appropriate issue type.

IncidentJiraCatSub

When the incident is created, the information is sent to JIRA and a corresponding ticket is created. JIRA responds to ServiceNow with the ticket information that was created. ServiceNow records that information both as a comment and saves the unique ticket ID in the incident’s “Correlation ID” field.

When a corresponding JIRA issue is created, the ticket information is stored in a comment on the ServiceNow incident record.

When a corresponding JIRA issue is created, the ticket information is stored in a comment on the ServiceNow incident record.

Screenshot_2_15_13_8_14_AM

After the JIRA issue is created, ServiceNow will store the JIRA ticket number in the incident’s “Correlation ID” field. It will also set the “Correlation Display” field to ‘JIRA Integration’.

Once this handshake has taken place, if you were to go and view the incident record, you will notice a button labeled: “View JIRA Record”. When this button is clicked, a new window will pop up with the JIRA issue shown.

Screenshot_2_15_13_8_17_AM

If someone were to add a comment on the ServiceNow incident, the comment is sent to the JIRA instance and added to it’s comment history.

If a technician were to add a comment to the JIRA issue, that comment will be brought it either 1) by a scheduled query that ServiceNow can make to the JIRA issue on a regular basis, or 2) a web service call made from JIRA to the Inbound JIRA Web Service Import Set endpoint.

State changes in ServiceNow will be reflected in JIRA and vice/versa.

Architecture

REST based JIRA Integration Diagram

Setup & Configuration

STEP 1: Install the Update Set
Download the update set listed at the bottom of this blog post. Preview the update set and then commit it.

Once you install the update set, there will be a new application in your Navigation Pane. You may have to refresh the navigation pane to see it.

The JIRA PoC Application that is installed through the update set

The JIRA PoC Application that is installed through the update set

STEP 2: Configure the Application

Click on the “Settings” link under the Configuration section of the application.

Most of the settings should be self explanatory.

Here is a screenshot of the settings available for the integration:

Screenshot_2_15_13_12_16_PM

Pulling JIRA for updates and applying them to ServiceNow

There is a section in the settings that allow you to configure the integration to Pull updates from JIRA, rather than receive them from JIRA directly. This is a useful setting when you are in a Hosted JIRA instance that does not give you the power to send Web Service calls to ServiceNow on required events.

The following settings allow you configure the pulling schedule, etc.

Screenshot_2_15_13_12_18_PM

Pushing JIRA updates to ServiceNow

If you are in a dedicated, on-premise JIRA instance, it is recommended not to pull data from JIRA, but rather send web service requests ServiceNow. The integration provides a web service for this purpose. To view the Web Service URL for your instance, browse to the integration application and click on “Inbound JIRA Web Service”. You will be presented with the web service and the corresponding WSDL address for SOAP web service calls.

Screenshot_2_15_13_12_02_PM

The following are sample SOAP calls you could make from JIRA:

Change issue type (subcategory) to Improvement

Set the “u_issue_type” element to one of the values of the Subcategory dropdown choices on the incident form for JIRA Issues as the category.

1
2
3
4
5
6
7
8
9
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_jira">
   <soapenv:Header/>
   <soapenv:Body>
      <u:insert>
         <u_issue_number>TST-49632</u_issue_number>
         <u_issue_type>Improvement</u_issue_type>
      </u:insert>
   </soapenv:Body>
</soapenv:Envelope>

Change Status to Closed

Send the JIRA status code in the “u_status” field. We will convert it to a ServiceNow state.

1
2
3
4
5
6
7
8
9
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_jira">
   <soapenv:Header/>
   <soapenv:Body>
      <u:insert>
         <u_issue_number>TST-49632</u_issue_number>
         <u_status>6</u_status>
      </u:insert>
   </soapenv:Body>
</soapenv:Envelope>

Change the Short Description on the Incident

Set the “u_summary” field to have the updated Short Description text.

1
2
3
4
5
6
7
8
9
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_jira">
   <soapenv:Header/>
   <soapenv:Body>
      <u:insert>
         <u_issue_number>TST-49632</u_issue_number>
         <u_summary>?</u_summary>
      </u:insert>
   </soapenv:Body>
</soapenv:Envelope>

Add a comment to the incident

Set the “u_comment” element to the comment string you will be adding to the incident.

1
2
3
4
5
6
7
8
9
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_jira">
   <soapenv:Header/>
   <soapenv:Body>
      <u:insert>
         <u_issue_number>TST-49632</u_issue_number>
         <u_comment>My comment goes here</u_comment>
      </u:insert>
   </soapenv:Body>
</soapenv:Envelope>

Demo Video

Download the Update Set

Download the latest update set on ServiceNow’s SHARE portal:
REST Based Integration for Jira – POC

0saves
If you enjoyed this post, please consider leaving a comment or following John Andersen on Twitter.

19 Responses to “REST Based ServiceNow / Jira Integration (PoC)”

  1. Dear John,

    Thank you for sharing this information!

    Best regards
    Jürgen

  2. Samir says:

    Hi, very interesting information.
    How much workload can this integration take?

    Is it somthing that an Administrator would do let’s say in 1 hour ?

    Thanks

  3. John Andersen says:

    @Samir, This was meant as a proof of concept and should be used as a kickstart to deploying your own Jira integration. I would recommend putting a developer on it or hiring a consultant to do polish up the implementation in a more formal way. I don’t typically maintain these update sets as official production level sets as I don’t have time to keep up with them all.

    That being said, I would imagine, if you were to configure this AS-IS, it would probably take 1-2 hours for an administrator to set up. That is assuming you have a set of Jira API credentials that you can use in the integration and that you are using the pulling mechanism to get ticket updates from Jira.

  4. Maryam says:

    Hi,
    I have followed all the instruction, but I don’t know where I should Change issue type (subcategory) to Improvement.

    I could open the WSDL, but the corresponding SOAP is not available.

    I have created a ticket in ServiceNow, couldn’t find it in JIRA.

    I appreciate your advice.

  5. Maryam says:

    Hi,

    Thanks for sharing. The instruction is very accurate.
    Everything is almost working for me now. A corresponding JIRA issue is created for a new incident.
    The issue is the “ID” and “Issue Number” are undefined and this is the https://jira.atlassian.com/browse/undefined.

    I will appreciate your help,

  6. John Andersen says:

    @Maryam…looks like your project ID is having issues. You must set this in the properties and it needs to match the project as it appears in the URL of the Jira ticket. I can’t tell you much more from my viewpoint without seeing your logs, your setup, etc.

  7. Maryam says:

    I couldn’t find anyway to set the project ID in Service-Now.

    The Project I created has a Project Number and sys_id.

    Could you please let me know how to set it up.

  8. Guy Y says:

    Just to save future people working on this integration a little bit of time: if you get this error:

    “Field ‘customfield_xxxxxx’ cannot be set. It is not on the appropriate screen, or unknown.”

    Check that the field is:

    – Available for the issue type you’re trying to create
    – Available on the form for the user who’s trying to create it
    – Available either for the project you’re trying to insert to, or globally

  9. fernand says:

    HI john,
    why web services cant it be done with email notifications .

  10. John Andersen says:

    Yes, email notifications can do something similar, however, if you have the options of Web Services, that is usually the preferred option.

  11. fernand says:

    john
    can you please share the advantages of web services over email notifications.

  12. Joe M says:

    Hi John,

    Do we really need a MID Server to integrate with ServiceNow if Jira( Ver 6.1) is not over internet ?

  13. John Andersen says:

    @Joe – you only need a MID Server if the instance cannot reach the Jira Web Service Endpoint. If you establish a VPN tunnel between the ServiceNow instance and your network, then a MID Server would not be required.

  14. Gary Opela says:

    Hi John! Thanks for all of the work you do. I am about to embark on establishing the Jira integration here. I am very glad you have given a good starting point.

    We will have multiple projects in Jira. I think I’ve figured out how to dynamically pass the project instead of relying on the property. Also right now they have multiple field mappings for each project. I have come up with an idea how to do that, however they are getting pushed by management to keep the same mappings for all of their projects in Jira.

    Also we are going to try and tie in the Catalog/RITM/Cat Tasks and Change Request into Jira, so this has potential for lots of fun.

    We are still in the early stages. I’m still trying to get access to a test jira instance on our side, but hopefully will be making progress soon. I’ve set up the integration already and read through all of the scripts, mappings, packets, etc and it all looks pretty straightforward.

    Again, many thanks for all of the material!

  15. Gary Opela says:

    Okay, so trying to get this integration working for incident. Is there something on the Jira side that has to be turned on? It doesn’t look like my mid-server can communicate with the jira instance. I’m seeing errors like:

    ERROR: Web Service did not respond after 30 seconds

    Initial response: null

    And then the big one:
    Jira issue created: undefined

    This last one tells me that SN is sending the call off to Jira, and expecting a response, which would be the Jira issue’s identifier, but is getting nothing.

  16. Promila says:

    Servicenow and Jira can be integrated using informatica cloud. Please

    visit the following link-

    http://mansasys.com/servicenow

    Thanks,

    Promila

  17. Jason Petty says:

    Awesome John! Thanks for doing things like this in your blog!

  18. Rajnish Kumar says:

    Hi John,
    I am facing “Unknown Host” issue when I try to use the solution you have provided. When I try to access using browser with “http://my_jira_instance/rest/api/2/search?jql=created>-3m” I get the result but when I make a call from ServiceNow I get the error mentioned above.

    Any clue why?

    Thanks in Advance.

    Rajnish

  19. Philipp says:

    Hello Mister Anderson,

    did you ever used the Attachments REST Endpoint of Jira. I try to send a attachment from servicenow to jira without “curl”.

    I converted the Attachment into a Byte-Array, every time i send the file to jira i get a 500 response.

    Kind Regards
    Philipp

Leave a Reply

46 queries. 0.712 seconds