Assigned to field validation based on role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2024 11:30 AM - edited 09-14-2024 11:33 AM
Hello guys,
I have a requirement when a CIM task type is survey feedback and assigned to a any resolver group, then only users in that resolver group with the Survey Feedback role(resolver_group_manager) should show in assigned to field not all the users in that group should popup.
To Achieve this requirement I have created one script Include and used it in reference qualifier to filter the assigned to users based on the role but it is not working.
Script Include -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 09:25 AM
Hi @Brad Bowman no my script include is not in global scope also my reference qualifier is in different scope then global
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 12:17 AM
@Mani A , not working as expected I only want users with the mentioned role to be pop up in the assigned to field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 03:12 AM - edited 09-15-2024 10:55 AM
Ok then remove group memebers logic from my script then use remaining like below
getFilteredusers(taskType)
{
If (taskType=="3")
{ var userList = [];
var userRoleGR = new GlideRecord('sys_user_has_role');
userRoleGR.addEncodedQuery("user.active=true^role.name=fmg_resolver_group_manager");
userRoleGR.query();
while(userRoleGR.next()) {
userList.push(userRoleGR.user.toString())
}
return "sys_idIN"+userList.join(','));
}
};
Remove second parameter from script include function in ref Qual.which I mentioned earlier
I thought you had a group field so suggested that second parameter..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 09:37 AM
Still not working can you please check my script include once Table is sn_cim_task
Script Include -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 09:43 AM - edited 09-15-2024 09:45 AM
Script include function is incorrect
use same function which is used in ref Qual...getFilteredusers ..not FilteredUsers ( U should be small one) also put some logs in script include for debugging purpose
Also write retun statement after while loop..