No "Changed" operator in UI Policy condition ?

Andy Pickles
Tera Contributor

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

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

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);

https://docs.servicenow.com/bundle/quebec-application-development/page/script/client-scripts/concept...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

9 REPLIES 9

Prasad Pagar
Mega Sage

Hi @Andy Pickles 

As Allen mentioned, Please try client script as UI policy will not work 

Thank you
Prasad

Allen Andreas
Administrator
Administrator

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);

https://docs.servicenow.com/bundle/quebec-application-development/page/script/client-scripts/concept...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Wow Allen. I just realised 🙂 Thank you for highlighting.

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!