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

Harish Murikina
Tera Guru

Hi Ken,



                Write before insert business rule and set the group



if(current.called_id.state == 'MIAMI')


{


current.u_time_to_assign.setDisplayValue('MIAMI Service Desk');


}


else if(current.called_id.state == 'FLORIDA')


{


current.u_time_to_assign.setDisplayValue('FLORIDA Service Desk');


}


Hello. I have set a business rule to test this. I set it if the location = Portland, then assign to SN_PortlandHelp, for example. I set this on the incident table. When I test, I impersonate a user from Portland, and the location sets properly, but it is still assigning to some pre-defined group and not the group I specify. Something after the insert is affecting this.



Since I wasn't involved in the initial setup for this, I feel like I am trying to find a needle in a haystack. Thanks for the help, but I think I will put in a HI ticket to have someone look at this.


if it is happening AFTER the insert check the existing br's, client scripts, and ui policy scripts for assignment_group in the scripts... see which one is setting it.



the other place it MIGHT be is in the record producer..   you need to find where it is being set before you try to modify it.. imho.


No need to go for HI ticket to this issue. Check any Business rule over riding.


Hello. I have set a business rule you see below. It's the first in order, and this is literally what we would like to do - all incidents where the location is set to portland gets routed to the assignment group shown. I have impersonated someone from the Portland office and confirmed the location is set to portland when submitting the form. This still does not work, so there is something else at play here that I cannot see. I have checked other business rules and the script on the Record Producer does not do anything to set the assignment group. I believe there are assignment rules that will assign based on another field, but I was hoping business rules would override an assignment rule.


businessRule.jpg