- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 05:47 AM
I have a HR Case being created using a Record Producer. This record producer has a field 'type_of_event', variable type is 'look up select box'. I'm trying to configure an assignment rule which should look at this field value and if the value is 'Event 1', the case should be assigned to Group 1.
I have written the below script, but the assignment group is not being set.
var event=current.variables.type_of_event; //tried with type_of_event.toString() too, not working.
if (event == 'sys_id of the event') //tried giving name of the event too, not working.
{
current.assignment_group.setDisplayValue = 'Group 1'; //tried without setDisplayValue too
}
Solved! Go to Solution.
- Labels:
-
Case and Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 04:03 AM
I found the answer to my question. Firstly thank you Pradeep for trying to help me, much appreciated 🙂
After providing the basic conditions on conditions tab of the Assignment rule (to make sure it won't execute on all), gave the below script in the script section. Worked like a champ.
var quest = new GlideRecord('question_answer');
quest.addQuery('table_sys_id',current.sys_id);
quest.addQuery('question','sys_id of the question you are querying');
quest.query();
while(quest.next())
{
if(quest.value =='sys_id of the value it should query') // A1 certificate of coverage
{
current.assignment_group ='sys_id of the assignment group the request should be assigned';
}
else
{
current.assignment_group='sys_id of the assignment group if condition fails;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 05:52 AM
Hello Rashmi,
Below is the updated script.
var event=producer.variables.type_of_event; //tried with type_of_event.toString() too, not working.
if (event == 'sys_id of the event') //tried giving name of the event too, not working.
{
current.assignment_group = 'PASS SYSID OF GROUP 1'; //tried without setDisplayValue too
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 06:20 AM
Thanks for the quick reply Pradeep, have tried executing the above script; however the issue is it is not entering if loop at all. Just after Variable declaration I have given a log and there is no entry in the log table at all. Not sure if the variable type has any influence.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 07:04 AM
Hi Rashmi,
Thanks for the update. Please replace var event=producer.variables.type_of_event; with var event=producer.type_of_event;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2020 08:58 AM
Sorry Pradeep that didn't work neither. Good news is now the log table entry has changed from no entry to 'undefined'.