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

Hey David Dubuis



It works perfectly. I am beginner to servicenow, please send me some useful threads to learn.



Regards,


Gokulraj S.


There's a lot of good training material on the developer website, the scripting learning plans at the link below will be particularly useful if you're just starting out. You can also get your own personal developer instance on there so you can try things out and hone your skills.



https://developer.servicenow.com/app.do#!/trainlist/app_store_learnv2_scripting_jakarta_scripting_in...



Also, Service Now offer good training courses if you can afford them or if you can get your company to pay.



Other than that, searching the docs site for info, the developer site for API details and the community for specific solutions is the way forward! I found it particularly useful to look at the type of problems other people were posting on the community and trying to figure out my own solutions and then seeing what other people came up with.



Product Documentation | ServiceNow


https://developer.servicenow.com/



Good luck out there! Please mark my answer correct to close this thread down.


find_real_file.png



When I used the filter option same thing has happened it is assigned to network group.


Yeah, it hasn't updated the record though so if you right click and reload the form it'll revert to the previous value. if you want it to revert to the previous value you will need to use the script.


ohh okay.Anyway ,Thanks for the help man.