- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 10:17 PM
I have integrated snow and jira and to update the comments in snow from jira I am using scripted rest api.
The logs which I am recieving is as follows -
{"comment":[{"id":"11705","key":"SSP-9504","user":"Prajwal Ashok Nagrale","body":"Sent to SErvice"}]}
var requestBody = request.body.data;
var body = JSON.stringify(request.body.data);
var parser = new JSONParser();
var parameterArr = parser.parse(body);
var jr = new GlideRecord('incident');
jr.addQuery('correlation_id', comment.key);
jr.query();
if (jr.next()) {
var JiraComment = parameterArr.comment.body;
jr.work_notes = 'Commented by: ' + parameterArr.comment.user + '\nComment: ' +JiraComment;
jr.update();
}
But this is not updating anything in incident table work notes.
Where am I wrong in this ?Please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 10:31 PM - edited 06-20-2023 10:46 PM
Hi, this is the second time you have posted this question\issue within 24 hours.
The earlier post probably received no reply as it contains no clear details of your configuration or diagnostics\debugging.
Are you updated Incident directly, or are you posting to an import table direct or via scripted rest API?
What are the results of your debugging, in the other post you imply that the body is not extracted from the payload but do not make this clear. Perhaps you could provide some clear and specific details regarding your configuration and diagnostics?
EDIT
Have you checked to see if your existing glide query retruins a record for jr.addQuery('correlation_id', comment.key);
Your payload seems to show 'Comment' is an array so perhaps this needs to be allowed for IE
parameterArr.comment[0].key
parameterArr.comment[0].body
Also, it is unnecessary to post the same question multiple times and if anything is less likely to result in a clear and complete answer to your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 10:31 PM - edited 06-20-2023 10:46 PM
Hi, this is the second time you have posted this question\issue within 24 hours.
The earlier post probably received no reply as it contains no clear details of your configuration or diagnostics\debugging.
Are you updated Incident directly, or are you posting to an import table direct or via scripted rest API?
What are the results of your debugging, in the other post you imply that the body is not extracted from the payload but do not make this clear. Perhaps you could provide some clear and specific details regarding your configuration and diagnostics?
EDIT
Have you checked to see if your existing glide query retruins a record for jr.addQuery('correlation_id', comment.key);
Your payload seems to show 'Comment' is an array so perhaps this needs to be allowed for IE
parameterArr.comment[0].key
parameterArr.comment[0].body
Also, it is unnecessary to post the same question multiple times and if anything is less likely to result in a clear and complete answer to your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 10:34 PM
I am updating the incident table directly, there is no import set table