Get record from incident that triggered the workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 09:07 PM
Hi,
I am new to ServiceNow. I have created a workflow that triggers on whenever priority changes to 1 of the incident. Then it runs a script. The code in the script is failing to get the current record that triggered the workflow. This is my script for testing :
workflow.info("start");
workflow.info(current.variables.sys_created_by);
var created=current.sys_created_by;
gs.info(created);
workflow.info(created);
workflow.info(current.assignment_group);
//current.getValue(fieldName);
var location=current.Location;
workflow.info(location);
No issues with triggering the workflow but I am not finding any current value in workflow log. Please help me on how to use the current, to get the record that triggered this workflow.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 11:32 PM
Nevermind, I made a silly mistake, now I can see the values in workflow log.
Thanks
Ashim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 12:28 AM
Glad to help.
If my response helped please mark it 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-20-2022 09:53 PM
Thank you for marking my response as helpful.
If my response helped please mark it 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-19-2022 11:40 PM
- <location display_values="test">fh4567df2389454082efjsjfkjer</location>
current.location gives the "fh4567df2389454082efjsjfkjer".
How can we get value "test" ?
Regards
Ashim