- 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 10:18 AM
Can you create a test record producer in a personal dev instance and reproduce this issue?
- Pradeep Sharma
- 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;
}
}