- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 01:23 AM
I created a UI Policy for a condition and wrote a script in advance view as the following:
function onCondition() {
g_form.setValue('assignment_group', "SNS - Admin");
}
The group exists, and the form shows the change but when I click save on the form it shows the following error below the assignment group field:
Match not found, reset to original
The table being used for this UI policy is part of a scoped custom application that inherits from the Incident table. The UI Policy is properly scoped. When I select the assignment group from the list of groups, I can save properly.
I tried the same by creating a client scrip and the same error is shown.
Can someone please let me know how I can fix this issue?
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 01:36 AM
Can you try the doing the same using sys_id of the group instead of the name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 01:36 AM - edited ‎01-09-2024 01:37 AM
Hello @Navaneeth1,
Assignment group is reference field so, you need to set sys_id of the group instead of group name.
Add sys_id of the group instead of group name.
Please refer below code:
function onCondition() {
g_form.setValue('assignment_group', "sys_id_of _the_group");
}
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 01:38 AM
Hi Navneeth,
Assignment group is a reference field so it accepts sys_id as a value & not display value of the group so please pass sys_id in your set value like below.
g_form.setValue('assignment_group', 'SYS_ID of Assignment group');
If my answer helps then please mark it correct.
Thanks,
Utpal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 02:06 AM
Hey @AndersBGS ,
I tried assignment rules but they don't seem to change once the tickets get assigned once and the condition changes. I want the assignment group to change based on a condition. Do you know of a way to make assignment rules work like that as in change once the group is already assigned?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 03:08 AM
Hi @Navaneeth1 ,
No, sorry - though it was only 1st assignment :). Basic, I would still recommend you to move to server side script (business rule), as server-side scripts are considered preferable where possible, as they can run in the background away from the user, whereas client-side scripts run in front of the user and often cause the most delay in loading pages.
So basic, you can still have a server-side business rule verify the conditions and update the assignment group based on your needs.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/