How to set catalog UI policy's condition as: "Assigned to" of ticket not empty

Junyu
Tera Contributor

Dear all,

 

I am working for maintain item and I have an variable "Additional E-mail" only visible and editable on agent screen.

Now I want to use the UI policy to set on agent screen for the ticket if the "Assigned to" is empty then the "Additional E-mail" should be optional, after filling "Assigned to" then the "Additional E-mail" variable be mandatory, I can't do that in UI policy since I didn't find the condition for "Assigned to", can you show me how to do that?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Junyu 

catalog UI policy can only add condition on variables and not fields of form.

you can use onLoad normal client script on that table i.e. RITM or sc_task and check the field value and based on that show/hide the variable using this syntax

g_form.setMandatory('variables.variableName' , true);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Luxo Nadappan
Tera Guru

hi ,

Not sure if i understand correctly, you can create UI Policy against the "Workspace" view .

 

Regards,

Luxo

Ankur Bawiskar
Tera Patron
Tera Patron

@Junyu 

catalog UI policy can only add condition on variables and not fields of form.

you can use onLoad normal client script on that table i.e. RITM or sc_task and check the field value and based on that show/hide the variable using this syntax

g_form.setMandatory('variables.variableName' , true);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Thanks for your answer, can you give me a complete example for client script? In addition, it seems that I can only use catalog client script (cannot use table) on the maintain item page. Can you tell me how to do it?

@Junyu 

you said it's for field so I assume it's normal form and not catalog form

So in that case you need to use normal client script

Also you mentioned assigned to so usually we have this field on RITM form or sc task form

and why would agent work on catalog item form while submission?

Please ensure you describe your exact requirements with screenshots.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader