- 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
11-04-2025 07:15 AM - edited 11-04-2025 07:16 AM
I've just discovered this, but unchecking 'On load' on the Advanced view form creates the same logic as "changes to". The documentation also seems to confirm this:
Option for specifying that the UI policy behavior should be performed OnLoad as well as when the form changes.
- In the When to Apply section, adds the condition [State] [is] [Awaiting user info] and clears the On load check box. This condition means that the UI policy applies only when the state is changed to Awaiting user info.
- In the UI Policy Actions related list, creates a record that makes the Additional comments field mandatory when the condition is met.