How to re-assign an incident to other group if the user is a member of that group only?

gokulraj
Giga Expert

I have a requirement like all software assignment group incidents have to assign to network group only by the network group members.How to achieve this?

Regards,

Gokulraj S

1 ACCEPTED SOLUTION

It hasn't updated the record, you can another line to return it to the previous value.



if(!gs.getUser().isMemberOf('Network') && current.assignment_group.getDisplayValue() == 'Network'){


gs.addErrorMessage('only Network team members can assign to the Network group');


current.assignment_group = previous.assignment_group;   //revert to previous value


current.setAbortAction(true);


}


View solution in original post

14 REPLIES 14

roehltablada
Mega Guru

Hi gokulraj,



Change the Assignment Group.




Regards,



Roehl Tablada


Hi Roehl Tablada



                That change should done only by network group members not by any other group member.


Hi gokulraj,



Then there's no way around it. Email them to act on the incident.




Regards,



Roehl Tablada


Dubz
Mega Sage

Hi Gokulraj,



You could create another script include for the assignment group to exclude the network group as an option if the currently logged in user is not a member of the network team.



I'm not sure if there isn't a better way to do it though, you might find your requirements for assignment groups become quite prescriptive and you have a large unmanageable script include accounting for a large number of different situations.



Logic would look something like this though, if this is the potential rabbit hole you want to go down.



var groups = 'sys_id=1234'


if(!gs.getUser().isMemberOf('Network')){


var gr = new GlideRecord('sys_user_group');


gr.addQuery('name', '!=', 'Network');


gr.query();



while(gr.next()){


groups += ('^ORsys_id=' + gr.sys_id);


}


}