- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 02:11 AM
Good morning, I have this story add a reference qualifier to the Affected User field. Users who can be selected in this field must:
* Belong to the 'ITSM App-Dev' group OR
Have one of the following roles (sn_incident_read or sn_incident_write or User.department = IT).
I've tried creating an include script to filter and then add it to the reference qual but I'm not really sure how I should do it.
thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 02:33 AM
Hi @Tomas Linde ,
Reference Field type can be used for only one Table reference not 2 tables simultaneously.
for your requirement, you can use for group which looks for the "sys_user_grmember" table.
You need advanced reference qualifier for this. Create a script include and put this script in there
function GetExecutiveMembers(){
var id=[];
var gr= new GlideRecord('sys_user_grmember');
gr.addQuery("group.name","your group name");
gr.query();
while(gr.next()){
id.push(gr.getValue("user"));
}
return "sys_idIN"+id.join();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 02:33 AM
Hi @Tomas Linde ,
Reference Field type can be used for only one Table reference not 2 tables simultaneously.
for your requirement, you can use for group which looks for the "sys_user_grmember" table.
You need advanced reference qualifier for this. Create a script include and put this script in there
function GetExecutiveMembers(){
var id=[];
var gr= new GlideRecord('sys_user_grmember');
gr.addQuery("group.name","your group name");
gr.query();
while(gr.next()){
id.push(gr.getValue("user"));
}
return "sys_idIN"+id.join();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 02:42 AM
Thank you very much for the help @Community Alums !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 02:45 AM
Glad to see i could help you @Tomas Linde