Restricting a particular usergroup to assign ticket to only one group

Sarva
Tera Contributor

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!

1 ACCEPTED SOLUTION

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';
}
},

Screenshot 2023-01-12 at 11.54.41 AM.png

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)

Screenshot 2023-01-12 at 11.54.50 AM.png

Now if i impersonate as a user of Application development group, i will be able to choose only 1 record.

Screenshot 2023-01-12 at 11.52.28 AM.png

 

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.

Regards,
Johns M P

View solution in original post

3 REPLIES 3

Johns_MP
Giga Guru

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.?

Regards,
Johns M P

Sarva
Tera Contributor

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

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';
}
},

Screenshot 2023-01-12 at 11.54.41 AM.png

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)

Screenshot 2023-01-12 at 11.54.50 AM.png

Now if i impersonate as a user of Application development group, i will be able to choose only 1 record.

Screenshot 2023-01-12 at 11.52.28 AM.png

 

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.

Regards,
Johns M P