Integration Issue key not defined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 01:25 AM
Hello All,
We are currently working on integrating Jira with ServiceNow using a Scripted REST API.
Below is the script snippet being used:
var data = request.body.data;
gs.info("Attachment Logs: " + JSON.stringify(data)); // Log is printed
var key1 = data.issue.key;
gs.info("Issue key: " + key1); // This log is also printed with the correct issue key
Despite the logs being printed correctly, I’m receiving the following error:
"key1" is not defined.: com.glide.rest.domain.ServiceException: "key1" is not defined.:
Thank you,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 01:46 AM
Hello @rohit_murli, could you try to use 'request.body.dataString' instead of 'request.body.data'.
Also, please print the data variable and share the output.
Regards,
Nishant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 03:19 AM
sorry didn't get your exact issue
Both the logs are printed correctly and you are able to get values but still some error is coming?
Please share the complete script and what came in logs
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 03:27 AM