Automatically setting assignment group if caller is from a certain state

kenneth2k1
Kilo Expert

Hi all:

I can't quite figure out how to automatically set the assignments group is the person reporting the incident/request is from a certain state. We have a number of users who should be assigned to a specific assignment group if their user account lists their city as Portland. It doesn't look like this can be done by an assignment rule, does this have to be worked into the workflow? If so, could you help me with the script syntax?  

Thanks for any help or insight on this!

1 ACCEPTED SOLUTION

Yes I had noticed that too



I fixed it, yet it still wasn't working as expected. First, I have discovered that there will need to be different methods for incidents and requests.



For example, for incidents, a business rule will get overridden by an assignment rule. And for requests, a business rule or client script will be overridden by a script that is run in a workflow. We have auto assignment happening by assignment lookup rules, assignment rules, and workflows depending on request or incident. So the answer is tricky.



2015-02-26_15-49-10.jpg



With servicenow help desk's help, we have been able to get a resolution by using an assignment lookup rule that runs on the incident table to assign to the desired group if the location is "Portland." The order is set so that it is before any other rule that sets an assignment group. So the other suggestions made in this thread might have worked, but there are multiple ways to auto assign the group, and these assignment data lookup rules always take precedent



...except with requests. Working with SN on those, since the technician was also having a difficult time determining what takes precedent over what, and what the proper way might be to set these (currently setting them in the workflow will probably be the solution).


View solution in original post

24 REPLIES 24

Ken,



There is a typo in current.assginment



I think it would be better to use the location name. Writing explicit code makes commenting redundant, in the following example you don't need to write the comment about Portland, also is not a good idea to hardcode the sys_ids.



var userLocation = producer.location.name; //I'm not sure what field has Portland as value, I'm guessing it is name but you need to verify.


if (userLocation == 'Portland'){


        current.assignment_group.setDisplayValue('SN_Shiftwise_ServiceDesk')


}


current.update();


Yes I had noticed that too



I fixed it, yet it still wasn't working as expected. First, I have discovered that there will need to be different methods for incidents and requests.



For example, for incidents, a business rule will get overridden by an assignment rule. And for requests, a business rule or client script will be overridden by a script that is run in a workflow. We have auto assignment happening by assignment lookup rules, assignment rules, and workflows depending on request or incident. So the answer is tricky.



2015-02-26_15-49-10.jpg



With servicenow help desk's help, we have been able to get a resolution by using an assignment lookup rule that runs on the incident table to assign to the desired group if the location is "Portland." The order is set so that it is before any other rule that sets an assignment group. So the other suggestions made in this thread might have worked, but there are multiple ways to auto assign the group, and these assignment data lookup rules always take precedent



...except with requests. Working with SN on those, since the technician was also having a difficult time determining what takes precedent over what, and what the proper way might be to set these (currently setting them in the workflow will probably be the solution).


I would work at at normalizing this... see if you can get it all working off of the assignment table... or move it all to scripts.. having a mishmash of solutions like this will make maintaining it a major pain moving forward!


You are correct sir! Not happy with the SN build team that set these up initially.



Thanks all.