UI action condition issue

Developer3
Tera Expert

I am calling a script include from UI action condition. Below is the sample script called in the function -

 

var ans=false;
if(gs.hasRole('itil')&& (current.getValue('state')==='1' || current.getValue('state')==='2') )//sample state values
{
ans=true;
}
return ans;

 

When the state does not match, the button is still being visible. I tried putting log statements and before the return statement, ans value is not displayed for negative scenario. I am not getting where the mistake is. Please suggest.

 

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

What does your condition look like?  Did you try logging current.getValue('state')? If it is incorrect in any/all test cases, try instead passing it in from the script call in the condition as a function argument. Is the actual script and/or condition longer than this - otherwise, why not add something similar directly to the condition? 

Sandeep Rajput
Tera Patron
Tera Patron

@Developer3 Could you please share how your condition field value looks like on UI Action