Code working in background script but not working in run script(workflow).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2022 02:47 AM
I am getting approver name
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval.number','RITM0395743');
gr.addQuery('state','requested');
gr.query();
if(gr.next())
{
gs.log(gr.approver.name,"Approver");
}
but when I am using the same code in the run script, it does not even go into the if statement
Labels:
- Labels:
-
Service Portal Development
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2022 03:13 AM
If var ritm = current.number.toString() or var ritm = current.getValue('number') doesn't work, the only other thing I can think of is that maybe your workflow is running in a scoped application, where gs.log() doesn't work. Try using gs.info() instead