- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 11:28 AM
Hi,
I have the fields Assignment group and assigned to on incident table. I have a requirements to populate Assignment group as the 'caller' group and the assigned to as the caller.
How can I achieve that?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 05:49 PM
If you want to do it via OnLoad Client Script + Display BR then below code can help you
in Display BR
var caller = current.getValue('caller_id'); // mention proper column name of caller_id and it gives us the sys_id
var gr = new GlideRecord('sys_user_grmember_list'); //navigating to group members and checking the user's groups
gr.addQuery('user',caller); //As you have mentioned there will only be one caller to the group I'm going with if, else we need to use while
gr.query();
if(gr.next()){
g_scratchpad.group = gr.group; //this will fetch you the sys_id of the group
}
In Client Script
if (g_scratchpad.group) {
g_form.setValue('assignment_group', g_scratchpad.group);
g_form.setValue('assigned_to',g_form.getValue("caller_id")); //as you have mentinoed the assigned_To needs to be same as caller.
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 05:20 PM
Hi @Alon Grod ,
Follow these steps:
System Policy > Rules > Assignment
Click New
Give it a name for example : Assigned_to and Assignment_group based on caller
Navigate to Applies to section and mention the table as incident and give the conditions as per your requirement
Navigate to Assign To section and mention your assigned_to and assignment_group things.
If you need any script to be written you can mention in the script section.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 05:49 PM
If you want to do it via OnLoad Client Script + Display BR then below code can help you
in Display BR
var caller = current.getValue('caller_id'); // mention proper column name of caller_id and it gives us the sys_id
var gr = new GlideRecord('sys_user_grmember_list'); //navigating to group members and checking the user's groups
gr.addQuery('user',caller); //As you have mentioned there will only be one caller to the group I'm going with if, else we need to use while
gr.query();
if(gr.next()){
g_scratchpad.group = gr.group; //this will fetch you the sys_id of the group
}
In Client Script
if (g_scratchpad.group) {
g_form.setValue('assignment_group', g_scratchpad.group);
g_form.setValue('assigned_to',g_form.getValue("caller_id")); //as you have mentinoed the assigned_To needs to be same as caller.
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 11:08 PM
@Basheer Always have the right answers! thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 12:36 PM
You will find the perfect solution to this in this community post:
If helpful please mark as Helpful/Correct
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 01:14 PM
@Basheer can you please help me with the on load client script solution