- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 08:29 PM
Hi there,
I am trying to write a simple script within the workflow to fetch the current change id within the normal change workflow, i found out its not really working.
var gr = new GlideRecord("change_request");
gr.addQuery('number',current.sys_id);
gr.query();
i think the gr.addQuery('number',current.sys_id) is not working, but i cant find the right value to fetch , has anyone done this before ?
thanks
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:03 PM
You don't need to query the change record for that. Because you have all the attributes in the current object already. current.number will give you Change ID. current.sys_id will give you sysid of the change request
You can use current.assignment_group to get the sys id of the assignment group.
And current.assignment_group.getDisplayValue to get the display value of the assignment group.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 08:40 PM
You can use current.number, which will return you the change number.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 08:59 PM
Hi Sanjiv,
Thanks for replying, i tried with gr.addQuery('number',current.number);
but i dont think that worked. I am trying to get this workflow to look up the assignemnt group in change table, if its the right assignment then it will add that group to the change approvers list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:03 PM
You don't need to query the change record for that. Because you have all the attributes in the current object already. current.number will give you Change ID. current.sys_id will give you sysid of the change request
You can use current.assignment_group to get the sys id of the assignment group.
And current.assignment_group.getDisplayValue to get the display value of the assignment group.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:16 PM
Thanks Sanjiv,
it worked! iam new to servicenow and looks like i dont need a GlideRecord for this. by the way is there a way that I can explore all the possible variable that i can use after current.xxxxx.xxxxx.