
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2014 10:34 AM
Hi all,
I'm looking to have an assignment rule that runs when there is a blank catalog rule from a specific catalog item. (Not a RITM but the actual item itself)
Long and short is that if it is a catalog task from that item I want it to be routed based on location field of the requested user's profile record.
I'm trying to do this outside of workflow as I have to accommodate over 80 sites. I'm currently trying to do what was listed here:
Accessing a variable in an Assignment Rule in Catalog
but am not having any luck at all. I'm fairly new to service now and am trying to see the best approach. I currently have my catalog task in the workflow set to be blank, (no assignee or asignee group) to make this happen.
Looking for best approach options here.
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 07:18 AM
You could do something like that, although I would highly recommend populating your locations with this data so you don't need a bunch of if/else statements.
Your script should look something like this. I'm using setDisplayValue() and getDisplayValue() so you can work with the friendly names of your groups and locations rather than their sysids:
var loc = current.request.requested_for.location.getDisplayValue();
if (loc == 'Location1' || loc == 'Location2' || loc == 'Location3') {
task.assignment_group.setDisplayValue('USA Support');
} else if (loc == 'Location4' || loc == 'Location5' || loc == 'Location6') {
task.assignment_group.setDisplayValue('Canada Support');
} else {
task.assignment_group.setDisplayValue('Global Support');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2014 08:41 PM
Hi Derek,
Could you post the code you're using?
If this is specific to just one catalog item and workflow rather than all of your catalog tasks, I would use the script field inside of the catalog task activity to set the assignment group based on location. There aren't a lot of specifics in your post, but if I was setting this up I would have a support group specified for each location and use that to assign the task based on the requester. You could do it all in one line of code inside of the workflow activity. Something like:
task.assignment_group = current.request.requested_for.location.u_support_group;
That may be oversimplifying your situation a bit, but for a catalog task I typically use the task activity to manage the assignment rather than an assignment rule as the assignment tends to be more specific to different types of items than global like incident or change.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 04:50 AM
HI Brad,
Thanks for your reply! It is specific to one catalog item. We have groups in place for the various locations already and they cover multiple sites. Based on your comments it does seem like I have to put it into the workflow and on the script side of the catalog task.
So I'm guessing i'm looking at a condensed script assignment. IE:
if current.request.requested_for.location = x or x or x then
task.assignment_group == name of group
Does that sound correct? I haven't had java-script training yet so i'm learning as I go here. I was trying to avoid doing it inside the workflow originally, but if it is the best way and affects performance less then a global rule I am for it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 07:18 AM
You could do something like that, although I would highly recommend populating your locations with this data so you don't need a bunch of if/else statements.
Your script should look something like this. I'm using setDisplayValue() and getDisplayValue() so you can work with the friendly names of your groups and locations rather than their sysids:
var loc = current.request.requested_for.location.getDisplayValue();
if (loc == 'Location1' || loc == 'Location2' || loc == 'Location3') {
task.assignment_group.setDisplayValue('USA Support');
} else if (loc == 'Location4' || loc == 'Location5' || loc == 'Location6') {
task.assignment_group.setDisplayValue('Canada Support');
} else {
task.assignment_group.setDisplayValue('Global Support');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 07:31 AM
Most likely I will have to do that script. (thank you for providing the basis of it!) I would prefer a more dynamic way but I cannot populate the locations as my locations are being dynamically updated from our AD. Can you clarify a little more on your recommendation perhaps we can avoid the static code route.