- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 01:32 AM
I have integrated ServiceNow and Jira using rest message. Now I want that whenever any change is made to the incident record in ServiceNow, it should also get updated on Jira. For this I am using PUT method. The endpoint for PUT method I am using is https://***************/rest/api/3/issue/SSP-8411, where SSP-8411 is the issue ID of Jira. This is a hardcoded value. How can I use this dynamically?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 12:23 AM
Hi,
then update as this
(function executeRule(current, previous /*null when async*/) {
try {
var r = new sn_ws.RESTMessageV2('Neste Siili JIRA', 'PUT');
r.setEndpoint('https://**************/api/3/issue/' + current.correlation_id);
r.setStringParameter('summary', 'Test Silli JIRA INT 2.0');
r.setStringParameter('description', 'Test Silli JIRA PUT');
r.setStringParameter('priority', 'Minor');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log("put body jira"+responseBody);
gs.log("put status "+httpStatus);
}
catch(ex) {
var message = ex.message;
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 11:07 PM
I am storing the Jira Issue ID in correlation ID of incident field in Serviceow.
The Business rule I have written is -
(function executeRule(current, previous /*null when async*/) {
try {
var r = new sn_ws.RESTMessageV2('Neste Siili JIRA', 'PUT');
r.setEndpoint('https://**************/api/3/issue/{current.correlation_id}');
r.setStringParameter('summary', 'Test Silli JIRA INT 2.0');
r.setStringParameter('description', 'Test Silli JIRA PUT');
r.setStringParameter('priority', 'Minor');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log("put body jira"+responseBody);
gs.log("put status "+httpStatus);
}
catch(ex) {
var message = ex.message;
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 12:23 AM
Hi,
then update as this
(function executeRule(current, previous /*null when async*/) {
try {
var r = new sn_ws.RESTMessageV2('Neste Siili JIRA', 'PUT');
r.setEndpoint('https://**************/api/3/issue/' + current.correlation_id);
r.setStringParameter('summary', 'Test Silli JIRA INT 2.0');
r.setStringParameter('description', 'Test Silli JIRA PUT');
r.setStringParameter('priority', 'Minor');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log("put body jira"+responseBody);
gs.log("put status "+httpStatus);
}
catch(ex) {
var message = ex.message;
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 10:21 PM
Thank you for confirming that my approach worked for you.
Please mark my response as correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 11:01 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 01:22 AM
Thank You
Can you also please let me know how I can send and update the work notes and additional comments from servicenow to jira