- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 06:18 AM
Hi ,
As part of our requirement , need to check logged in user is member of assignment group or not which is present in standard change template.
can anyone please give me any idea "how to get the value of assignment group " which is present under change_request values in templates . Attaching screenshot
Anyidea really helps alot
Regards
Anusha
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 06:51 AM
Hi,
Not sure of your end result requirement here, but you can query the sys_template table for a specific sys_id (for example) and then look for the value of a specific entry on it. If you're doing this in the client, then you'd want to utilize GlideAjax to return that value back to your client from the server: https://community.servicenow.com/community?id=community_article&sys_id=9f7ce2e1dbd0dbc01dcaf3231f961...
In server side script, you could find value like this (EXAMPLE😞
var gr = new GlideRecord('sys_template');
gr.get('sys_id_of_template');
gs.info('***Short Description from Template is: ' + gr.short_description);
Then if it equals what you're wanting it to do, you could apply the template through script as well with:
https://servicenowguru.com/system-definition/advanced-templates/
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 06:51 AM
Hi,
Not sure of your end result requirement here, but you can query the sys_template table for a specific sys_id (for example) and then look for the value of a specific entry on it. If you're doing this in the client, then you'd want to utilize GlideAjax to return that value back to your client from the server: https://community.servicenow.com/community?id=community_article&sys_id=9f7ce2e1dbd0dbc01dcaf3231f961...
In server side script, you could find value like this (EXAMPLE😞
var gr = new GlideRecord('sys_template');
gr.get('sys_id_of_template');
gs.info('***Short Description from Template is: ' + gr.short_description);
Then if it equals what you're wanting it to do, you could apply the template through script as well with:
https://servicenowguru.com/system-definition/advanced-templates/
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 11:22 PM
Hi Allen,
Thanks for the Reply.
But assignment group which is present under change_request (Tempalte_Value type) . So, not able to pull the assignment group value like short_description as this field is on the form itself.
Please see attached docs and suggest me how to get the value of asignment group.
Regards
Anusha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 11:37 PM
this sample script should help you get the value
Enhance it as per your requirement
var templateValue = "active=true^assignment_group=555aed3fc0a8016600657c7b0ddc6e97^short_description=hello";
templateValue = templateValue.split("assignment_group=")[1];
var group = templateValue.substring(0,32);
gs.info(group);
Output:
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
‎10-31-2022 09:36 AM
Hi ANkur,
Can you please advise how you were able to get the field name and its respective values.