- 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 09:18 PM
Thanks Brent, it worked! I am only new to servicenow and you are right i dont need to use GlideRecord for this. is there a way that i can explore all the possible switches after current.xxxx.xxxx in service now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:33 PM
Hi Rex,
If you right click on the header of a change request and select "Show XML" it will bring up a screen with all the technical names of the fields on a change request.
XML Form
All of these fields are available to you in the current object and are accessible with the following syntax:
current.<fieldname>;
current.<fieldname>.getDisplayValue();
Have a play around and see what you can pull out.
P.S. Remember to mark @Sanjiv Meher answer correct if it helped you. If you found the information I provided useful then please mark the comments as Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:47 PM
Thanks Brent, its good to know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2018 09:25 PM
Thank you guys both Sanjiv and Brent
