JIRA to service Now integration

rahulsahotay
Kilo Contributor

Hello:

I'm trying to integrate JIRA with Service now and i got the one which helped me a little bit (REST Based ServiceNow / Jira Integration (PoC) | John Andersen )

But while creating a ticket in SNOW it is not creating a corresponding issue in JIRA and I'm seeing below error

A corresponding JIRA Issue has been created:

ID: undefined

Issue Number: undefined

Issue URL: https://jira*****/browse/undefined

Please suggest how to get rid of this error ?

1 ACCEPTED SOLUTION

Good Morning Rahul,





I forgot to mention one really important thing!



My integration between ServiceNow and JIRA through the POC application works only when the incident which I am creating in ServiceNow has the following two elements:
- Category: "Jira Issue";
- Subcategory: "Task";



If the Subcategory is a different one, let's say "Bug" - then the same issue like yours will appear immediately after the submitting of the SNOW incident or in other words: the JIRA platform will be undefined.
But if you specify the Subcategory as "Task" - then the integration works: a corresponding case is being created in JIRA and the new button called "View Jira Record" appears in the case record in ServiceNow:


T8.png


I am not sure why the integration works only with SNOW incidents opened as tasks. I suppose this has something to do with the fact that the cases in JIRA are tasks.
In his presentation video (the link contained in the above post), Mr. Andersen is creating a SNOW incident which has Subcategory of "Bug". Maybe the fact that I am using a trial Cloud - based JIRA platform is causing the problem. I am not sure.



Anyway, if you create a SNOW incident of Subcategory "Task" - the integration should work fine. You should be able to exchange comments between the two platforms (SNOW & JIRA), to change the state of the incident and moderate its Urgency and Priority.



NOTE: in my integration only comments from ServiceNow can be forwarded to JIRA. If you add an update as a Work note - then it will not get forwarded to the JIRA case record. Only comments.




Best Regards,


Georgi Mavrodiev



IT Consultant


Do IT Wise



You may visit us in our Web Site: www.doitwise.com


View solution in original post

30 REPLIES 30

You will have a look into the JSON format of the POST message and map the wanted fields to the fields of snow.


For example some fields are not obviously and are called customfield_XXXXX, you have to test or look into the jira webpage and look into the source code or ask an engineer of your jira system.



This is the beginning of my processor:


var is = g_request.getInputStream();  


var sb = GlideStringUtil.getStringFromStream(is);


//gs.log(sb, 'jiraProcessor');


var parser = new JSONParser();


var parsed = parser.parse(sb);



There you have access to the json object through parsed.


* parsed.issue.key -> number


* parsed.webhookEvent -> this describes which updated happened


    - jira:issue_created


    - jira:issue_updated


    - jira:issue_deleted



My past self coded it all in the processor to create/update/delete the relevant records in service now.


Certainly there could also be much better approaches through data sources/transform maps but the processor fulfilled my need.


Hi dastu,

 

How did you handle the authentication from JIRA to SNOW using webhooks.

prachishah17
Kilo Contributor

Hi Rahul


SyncSnow is data integration platform which seamlessly connect/integrate servicenow with Jira or vice versa.                                                        


For more information   please go through blog   SYNCSNOW     JIRA —SERVICENOW INTEGRATION



b_e
Kilo Explorer

Hi genious ,

The same integration is not working for me.i did all what you said.but it not generating correlation ID.

i have created custom field as customfiled and i copy and paste the id into key.i dont know where i have mistake.

Thanks in advance

 

b_e
Kilo Explorer

In setting what i did for your information i attached here.please find and let me know.