- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 09:08 AM
Hello,
I am trying to restrict a user group in our Organization to assign ticket to only one group. They should not be able to assign tickets to any other group.
I have already created a before business rule for this group so that they will not be able to view any tickets which are not assigned to their group, now we need to restrict them to assign tickets to only one group apart from their group.
Please assist. Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 10:32 PM
Hi @Sarva ,
i have created an example below you can reference that and create your own scripts.
if a person who belongs to "Application Development" will be able to choose only "ATF_TestGroup_ServiceDesk" if the assignment group of current incident record is "Application Development".
You need two things for this - Advance Reference Qualifier and Script Include.
I have created below script Include. --> See snapshot for reference
restrictAssignmentGroup: function(restrictedAssignmentGroup){
var currentUser = gs.getUser();
if(restrictedAssignmentGroup == 'Application Development'){//give assignment group name which needs to be restricted to assign only to another group
if(currentUser.isMemberOf('Application Development')){ //to check if the current user is part of that group
var selectingAssignmentGroup = 'ATF_TestGroup_ServiceDesk'; //the assignemnt Group Name the user should select
return 'name='+selectingAssignmentGroup;
}
else{
//condition of your choice
return 'type=null^ORtype=1cb8ab9bff500200158bffffffffff62';
}
}
else{
//condition of your choice
return 'type=null^ORtype=1cb8ab9bff500200158bffffffffff62';
}
},
and in the Dictionary Entry of Assignment Group click on the advance view and Choose the reference as advanced qualifier and with the script as below: --> See snapshot for reference.
javascript: new IncidentAssignmentGroupRestriction().restrictAssignmentGroup(current.assignment_group.name)
Now if i impersonate as a user of Application development group, i will be able to choose only 1 record.
You can consider this as an example and you can come up with your own query.
Mark Helpful if it resolves in solving your query.
Johns M P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 09:17 AM
Hi @Sarva ,
Have you thought about creating a advance reference qualifier and creating a script include and calling the script include in the reference qualifier to achieve this behaviour.?
Johns M P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 11:00 AM
Hello @Johns_MP ,
I'm not sure on how to do that. Can you please give me an example if you don't mind.
Thanks,
Saravana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 10:32 PM
Hi @Sarva ,
i have created an example below you can reference that and create your own scripts.
if a person who belongs to "Application Development" will be able to choose only "ATF_TestGroup_ServiceDesk" if the assignment group of current incident record is "Application Development".
You need two things for this - Advance Reference Qualifier and Script Include.
I have created below script Include. --> See snapshot for reference
restrictAssignmentGroup: function(restrictedAssignmentGroup){
var currentUser = gs.getUser();
if(restrictedAssignmentGroup == 'Application Development'){//give assignment group name which needs to be restricted to assign only to another group
if(currentUser.isMemberOf('Application Development')){ //to check if the current user is part of that group
var selectingAssignmentGroup = 'ATF_TestGroup_ServiceDesk'; //the assignemnt Group Name the user should select
return 'name='+selectingAssignmentGroup;
}
else{
//condition of your choice
return 'type=null^ORtype=1cb8ab9bff500200158bffffffffff62';
}
}
else{
//condition of your choice
return 'type=null^ORtype=1cb8ab9bff500200158bffffffffff62';
}
},
and in the Dictionary Entry of Assignment Group click on the advance view and Choose the reference as advanced qualifier and with the script as below: --> See snapshot for reference.
javascript: new IncidentAssignmentGroupRestriction().restrictAssignmentGroup(current.assignment_group.name)
Now if i impersonate as a user of Application development group, i will be able to choose only 1 record.
You can consider this as an example and you can come up with your own query.
Mark Helpful if it resolves in solving your query.
Johns M P