- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2013 05:38 PM
I would like to use an assignment rule to assign an incident to the correct service desk group based on the callers geo location contained in the users record.
Any help on how to script this would be greatly appreciated - all my attempts have failed.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2013 11:19 PM
I have successfully used the following script to assign the group based on the users location.
var gr = new GlideRecord('sys_user');
if (gr.get(current.caller_id)){
var sd = gr.u_service_desk_geo;
current.assignment_group = sd;
}
However I am still having trouble setting the cmdb_ci value with the assignment rule script;
current.cmdb_ci = 'GSA';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2013 11:19 PM
I have successfully used the following script to assign the group based on the users location.
var gr = new GlideRecord('sys_user');
if (gr.get(current.caller_id)){
var sd = gr.u_service_desk_geo;
current.assignment_group = sd;
}
However I am still having trouble setting the cmdb_ci value with the assignment rule script;
current.cmdb_ci = 'GSA';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2013 06:11 AM
The cmdb_ci is a refernce to the CMDB table. It is looking for the sys_id in your current assignment OR you can try using current.cmdb_ci.setDisplayValue('GSA');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2013 11:01 AM
Thanks Terri and Shabab,
Using the sys_id of the ci successfully set the cmdb_ci value.
One thing that was not obvious to me (and making me believe my scripts were incorrect), if the assignment rule has the 'Assignment group' and/or 'Assigned to' then the script does not get invoked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2013 06:41 AM
current.cmdb_ci = 'GSA';
should be either be replaced with
current.cmdb_ci.setDisplayValue('GSA');
or
current.cmdb_ci = '000000';// sys_id of the GSA record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2014 05:39 AM
hi,
We can go to "Data lookup definitions" and create new data lookup by selecting source and matcher table. After save select matcher field and setter field definitions. Matcher field definitions are for matching values and setter fields are for to which field we have to set value.
Upload data in assignment rules table and check in u r incident form.
Refer wiki for how to create data lookup and assignment rules for better idea. If any queries feel free to send amil. So that i can help on the same.
I tried recently to auto populate one field based on few fields and it's working perfect.