UI action condition issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 03:29 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 04:13 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 04:25 AM
@Developer3 Could you please share how your condition field value looks like on UI Action