How to hide UI action in workspace in servicenow?

Buddy 1
Tera Contributor

Hi,
1. when state is "new" and "assigned to" is empty, show only UI action "Assign to me" ui action in workspace case form and hide other ui actions.

2. on click of "assign to me" need to check ,if the logged in user is part of "assignment group". If not, should show an error message.

3. Need to disable "Discuss"  ui action 

 

How to achieve this?

 

Thanks in advance!

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Buddy 1 

points below

1. when state is "new" and "assigned to" is empty, show only UI action "Assign to me" ui action in workspace case form and hide other ui actions. -> you can add this in the condition itself current.state == 'new' && current.assigned_to == ''

2. on click of "assign to me" need to check ,if the logged in user is part of "assignment group". If not, should show an error message. -> why not show the UI action only to the assignment group member; add this in condition along with above condition gs.getUser().isMemberOf(current.groupField);

3. Need to disable "Discuss" ui action -> add proper condition for that UI action

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

"Discuss" button is not in the ui action, it is in ux form ui action config. If we make it inactive. then also we were able to see the ui action in workspace.
can help in this?

Thanks in advance!

@Buddy 1 

Did you check the 1st 2 points?

then possibly the Discuss ui action is coming from platform level

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Samaksh Wani
Giga Sage
Giga Sage

Hello @Buddy 1 

 

1. add below UI Action condition in other UI action except from Assign to me UI Action

 

(current.state != "new" || assigned_to != " ")

 

 

2. 

 

var sys_id = current.assignment_group;
if(!gs.getUser().isMemberOf(sys_id){
gs.info("error_message");
}

 

 

3.  Go to Discuss UI action, Uncheck the Active Checkbox.

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh