- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2019 12:08 AM
Reference Qualifier for assignment group depending on Assigned to field.
After choosing the Assigned To field, the Assignment Group should show only the group of assigned to user.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2019 12:19 AM
Hi Lakshmi,
you are sending assigned_to value as parameter to the function from the ref qualifier but as per the function declaration it doesn't accept any parameter
so make these changes
1) make the function accept parameter
2) remove line number 7
3) in line number 9 use below; don't put quotes around the variable
gr.addQuery('user', a);
4) also use while instead of if in line number 11
5) while returning the array use join method
updated script
assignmentGroup: function(a){
var arryVal = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user',a);
gr.query();
while(gr.next()){
arryVal.push(gr.group.toString());
}
return 'sys_idIN' + arryVal.join(',');
},
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎08-26-2019 12:10 AM
Refer below link :
Advanced Reference Qualifier Using a Script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2019 08:39 PM
Hi Lakshmi,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement & close the thread. Thanks in advance.
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
‎08-28-2019 10:46 PM
Hi Lakshmi,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement & close the thread. Thanks in advance.
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-12-2019 12:12 AM
Hi Lakshmi,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement & close the thread. Thanks in advance.
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-02-2020 10:14 PM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate answer as correct & helpful to close the thread.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader