Assigning groups to sites as defaulted values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:24 AM
All,
How do I assign groups to sites as the defaulted value using either UI Policies or Business Rules.
I have a user who is asking that upon choosing a site for a ticket, is it possible to have assignment groups automatically populate in the groups field with manual input.
Additionally, does anyone have any insight into the onCondition function? When adding the script into the UI Policy, I am met with an error message stating the need to clarify the conditions, which I then do. But when I added the onCondition function string, I get no success from running the script. Am I overlooking something?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:47 AM
You can use a client script for this.
It should be an onChange client script on site field. When it changes, based on the value selected, set the assignment group in the script.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 12:44 PM
Hello @GB9414 ,
I think you should use the onChange client script and set the assignment group based on whatever the site value is selected.
Also you can refer to the code below to get the idea how you can use the client script and modify it according to you requirement or if you need any help regarding you can share some more details related to variables and their types of other details which can help to understand better.
onChange client script:
(function executeRule(current, previous /*null when async*/) {
// Check if the site field is modified
if (current.site.changes() && current.site) {
// Perform logic to determine the assignment group based on the selected site
var site = current.site.getDisplayValue();
// Example logic: Set assignment group based on the selected site
if (site === 'Site A') {
current.assignment_group = 'Group A';
} else if (site === 'Site B') {
current.assignment_group = 'Group B';
}
}
})(current, previous);
Also for your onCondition related query you can refer to this community post. UI Policy onCondition Script.
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Regards,
Aniket