- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2016 02:35 PM
Hi everyone,
I'm trying to add some logic to our Incident Record Producer script so that when a user submits the form through ESS with our 'Issue Type' variable set to 'Applications' and the Description contains the phrase 'onbase' to auto-assign to a particular group. Has anyone done something similar? Any help is appreciated.
Thanks,
Fred
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 01:22 PM
Hey Fred,
Adding this if statement to your record producer script should achieve what you're looking for.
if(current.[field "value" for issue type] == ["value" for applications] && current.["Value" for description].toLowerCase().indexOf('onbase') >=0)
{
current.assignment_group = "[sys_id of desired assignment group]";
}
if it doesn't work, try replacing "current" with "producer" and give it another go.
Good Luck,
-Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 12:49 PM
Check if you are already assigning the incident to some groups, as the assignment rules only work if the task is not already assigned to another user or group.
Kind regards,
Sourabh D

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 12:55 PM
Good catch. Record should be unassigned, it cannot overwrite the existing groups and also default value. Use a before business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 01:22 PM
Hey Fred,
Adding this if statement to your record producer script should achieve what you're looking for.
if(current.[field "value" for issue type] == ["value" for applications] && current.["Value" for description].toLowerCase().indexOf('onbase') >=0)
{
current.assignment_group = "[sys_id of desired assignment group]";
}
if it doesn't work, try replacing "current" with "producer" and give it another go.
Good Luck,
-Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 03:22 PM
Hi Ben,
'producer' worked like a charm! Thanks for your help and to everyone who chimed in. Much appreciated!
Cheers,
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 08:47 PM
Glad that worked for you! And good call by Chuck on using a property rather than hard coded sys id's.