Trying to create UI Action to make Incident fields hidden.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2023 11:38 AM
I am new to this whole scripting thing, but I am trying to create a UI action that will hide certain fields in the Incident ticket when the UI action is used. (Only certain groups/users will have be able to see the UI action). Below is what I have, but it is not working. Any help would be greatly appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2023 11:43 AM
Hi Robert,
You want to hide fields on click of button? If so, check for article.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2023 03:35 PM - edited ‎11-15-2023 10:12 PM
try this:
function markConfidential() {
g_form.setDisplay('description',false);
g_form.setDisplay('short_description',false);
g_form.setDisplay('work_notes',false);
}
editing my reply.
the above will hide the fields when you click it, but a browser refresh will bring them back. What you really need to be doing is setting a UI Policy to hide the fields on a specific condition. If there is a particular value for these records you can use (e.g. category = human resources) then you can associate the UI Policy with that condition to hide the fields from the form.
if you really want a UI action, it might be better to have the UI action set a form field to a specific value that the UI policy is looking for. Then the only way to return the make the fields visible again would be to change that field's value. Your UI policy could check the value of the field and act as a toggle. If value is true, make it false, if value is false - make it true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2023 08:40 PM
How are you going to bring these fields back if the conditions change?