How to create a multiple conditions in UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2015 06:42 AM
Hi,
Could you please help in creating a multiple condition check in UI Action condition.
1) i want to check if state == "open" UI action should be visible to only ITIL
2) if state == "work in progress" ui action should be visible to "change_admin" roled users.
thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2015 07:10 AM
How about:
((current.state == 9 || current.state == 11) && gs.hasRole('change_manager')) || (current.state != 11 && current.state != 9 && gs.hasRole('itil'))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2016 01:02 AM
Hi,
There cannot be multiple "States" applied at the same time.
Try with this:
((current.state == 9 || current.state == 11) && gs.hasRole('change_manager')) || ((current.state != 11 || current.state != 9) && gs.hasRole('itil'))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2015 07:05 AM
When you say it's not working do you mean that the condition is evaluated to true or false? Also, the state field is an integer so your numbers shouldn't be in quotes in this instance. Also, with your states whenever the state is 11 or 9, the first set of state conditions will be true as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2016 12:16 PM
Hi Ramu,
Simplify and break it down to find the failure in your condition. Start with just the roles comparisons, then add one condition at a time back in to see where your mistake lies.
Then comes the fun.
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2016 11:12 AM
Your condition should be like:
(gs.hasRole('itil') && !current.isNewRecord() && (current.state != '5' || current.state != '4' || current.state != '3')) || (gs.hasRole('change_manager') && (current.state == '11' || current.state == '9'))