- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 09:38 AM
Hi All,
Im really scratching my head here so please help .
Im trying to create a UI policy that will change the wok notes (internal) field on an incident form to mandatory if the assignment group changes.
We are trying to prevent the cold transferring of incident tickets.
However, in the "when to apply" section, there is no "Changes" operator that i can apply to the assignment group field.
I can compare it to itsself (Assignment group 'is different from' assignment group) but that doesnt work.
If I could get to the 'code' of the conditions somehow then i could add a VALCHANGES operator in there maybe ? But i cant seem to get to the code, only the drop down lists 😞
Could one of you experts please advise what would be the best way to achieve what i am looking to do ?
Apologies if its something simple .. Im not new to coding but im new to the ServiceNow platform and keen to learn.
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 09:44 AM
Hi,
The UI Policy runs on form load as well as when there's a change to the record (in client view).
For the assignment group field, as you've mentioned, there isn't a "changes" type operator, in the UI Policy settings (there is in business rules, though, just throwing that out there).
For this, you may need to use an onChange client script instead for the assignment group field and then set your field mandatory such as:
g_form.setMandatory('work_notes', true);
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 09:43 AM
Hi
As Allen mentioned, Please try client script as UI policy will not work
Thank you
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 09:44 AM
Hi,
The UI Policy runs on form load as well as when there's a change to the record (in client view).
For the assignment group field, as you've mentioned, there isn't a "changes" type operator, in the UI Policy settings (there is in business rules, though, just throwing that out there).
For this, you may need to use an onChange client script instead for the assignment group field and then set your field mandatory such as:
g_form.setMandatory('work_notes', true);
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 09:48 AM
Wow Allen. I just realised 🙂 Thank you for highlighting.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 10:16 AM
No problem, haha.
I had to check myself as I'm used to seeing/thinking there's a "changes" operator as well.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!