- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 04:59 PM
Hello all,
I created a record producer with 2 categories (Project, Software) and a couple of subcategories. The request is that if a certain category "Project" or its corresponding subcategories is selected then it should be assigned to assignment group "ABC", else it should be assigned to group "123".
I had included a line of script when it was only assigned to one person, but now that this requirement came up it no longer works. Is there a line of script I can add to separate the two, possibly an else statement?
Below is what currently is in place:
**We are on Istanbul
Thanks in advance!
Grace
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 06:24 PM
Your script shud be like below
if(current.category == 'inquiry' && (current.subcategory == 'antivirus' || current.subcategory == 'email'))
{
current.assignment_group = 'b85d44954a3623120004689b2d5dd60a';
}
else if(current.category == 'software' && current.subcategory == 'os')
{
current.assignment_group = 'aaccc971c0a8001500fe1ff4302de101';
}
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 05:19 PM
Have you checked out the Assignment Lookup Rules capability to see if that meets your requirement?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 11:40 AM
Thank you Paul for the suggestion! We have lookup rules set for the categories/subcategories for create new incident but this a record producer that has its unique category/subcategory.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 06:27 PM
In record producer script you can have like this
if(current.category == 'inquiry' && current.subcategory == 'antivirus')
{
current.assignment_group = 'b85d44954a3623120004689b2d5dd60a';
}
else if(current.category == 'software' && current.subcategory == 'email')
{
current.assignment_group = 'aaccc971c0a8001500fe1ff4302de101';
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 09:53 AM
Hi Harish,
Thank you for the script! I was able to set the assignment group for the first category "Project", but the else statement doesn't seem to be working because when the other category "Software" is selected it assigns to same assignment group as project.
This is what I have:
Thanks,
Grace