- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2021 05:12 PM
Team ...
Need your assistance here
I am testing a UI Action Button but would like it to only appear for the Emergency change type.
In the UI action, there is a Condition box.
What is the condition script code I need to type in for the button to only be visible for the Emergency Change type?
Many thanks for your help!
Zosy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2021 05:24 PM
Hi, if you check OOB UI actions there are a couple with conditions based on (or including) change 'type'
/sys_ui_action_list.do?sysparm_query=table%3Dchange_request%5EconditionLIKEcurrent.type&sysparm_view=
Based on the formatting\syntax of the examples you should be able to see that you need something like this
current.type == 'emergency'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2021 05:24 PM
Hi, if you check OOB UI actions there are a couple with conditions based on (or including) change 'type'
/sys_ui_action_list.do?sysparm_query=table%3Dchange_request%5EconditionLIKEcurrent.type&sysparm_view=
Based on the formatting\syntax of the examples you should be able to see that you need something like this
current.type == 'emergency'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021 04:18 AM
Hi Zosk,
What condition would you like to set in the UI Action?
There is a field called condition in the UI Action form
For example: you can do something like this bellow in the UI Action called work In Progress:
(current.state == '1') && ((current.assigned_to == gs.getUserID()) || gs.hasRole('sn_grc.manager'))
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2021 12:53 AM
Hi
Please enclose your existing condition in () and then add like below.
(existing condition here) && current.type=='emergency'
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2021 12:23 PM
Hi
If I helped you to resolve your query with my answer. Then I would really appreciate if you can mark my answer correct and helpful. So that it can be moved to answered list and helpful for future readers.
Regards,
Ujjawal