UI Policy doesn't work on RITM only

Joanna17
Tera Contributor

Hi everyone!

I want some variables to be visible only on the task level (so hidden for Catalog Item and RITM).

I used "Reverse if false" function on advanced UI Policy view, selected "Apply on Catalog Item view" and "Apply on RITM view" checkboxes, Apply on task view kept unselected,

mandatory and visible = false, read only = leave alone

Variables used in the policy are not part of any other policy or script (no client scripts included in that Catalog Item)

The policy is being applied as expected on the Catalog Item level (variables are hidden), on the task level (variables are visible and mandatory) but somehow it's not working on RITM (variables are visible and mandatory)

Anyone knows what may cause sth like that?

Thanks a lot for your help!

9 REPLIES 9

Hi Deepak,



It's something very similar to my issue, thank you.


I actually found the UI policy action for inactive item and removed it, however the problem still persist.



From the article about the Known Error I assume that the only way around it would be to wait for the Heslinki patching, is that correct?


deepakgarg
ServiceNow Employee
ServiceNow Employee

Yes, to have a permanent fix for this problem would be to upgrade to HP3, which has already been released.


Also, as the community article suggests, if you can delete all the non-existent variables reference from the UI policy, it will work. Please check if any other remaining variable is having the same issue, i.e., no valid reference to an existing variable.



Also, there is a script given in the comments of the KB article that will tell you the variables causing the issue:



var gr = new GlideRecord('catalog_ui_policy_action');



var cupaIDStr = "";


gr.query(); //Query the entire list of catalog UI Policy Actions to find the catalog_variable value



while (gr.next()) {


var cv = gr.catalog_variable.getDisplayValue();


var sID = cv.split('IO:')[1]; // Remove the IO: from the value in the catalog_variable IE: IO:d4892e556f081d00362401dfde3ee496


var upaName = gr.sys_name;


var upaID = gr.sys_id;


var gr2 = new GlideRecord('item_option_new');


gr2.addQuery('sys_id', sID);


gr2.query(); // Now we query all the variables in the item_option_new table to verify they exist



while(gr2.next()) {


if(gr2.getDisplayValue('active') == 'false'))


cupaIDStr += upaID + ",";


}



}


gs.info(cupaIDStr);



Please check once and lemme know if it helps you.


deepakgarg
ServiceNow Employee
ServiceNow Employee

Is your problem solved?


arnabwa
Giga Guru

Hi Joanna,



Could you please try increasing the Order of the UI Policy and check once. Just to be sure that this is not creating the trouble.


Try giving a high value like 1000 or 5000.


Please let me know your findings.



Thanks,


Arnab


Joanna17
Tera Contributor

Hello,


Yes, it should be all right, this is 6th UI Policy and its order is 700.