Hide "Close Task" Button in Service Operations Workspace Until Task Is Assigned to Logged-in User

priyanshp4
Tera Contributor

Hi Community,

I need some guidance regarding the Close Task button on Catalog Task (sc_task) records in Service Operations Workspace.

Currently, the Close Task button is available to all users who can access the task. As per our requirement, the button should:

  • Not be visible when the task is unassigned.
  • Not be visible when the task is assigned to another user.
  • Be visible only when the task is assigned to the logged-in user.

Example:

Assigned To Logged-in User Close Task Button
EmptyUser AHidden
User BUser AHidden
User AUser AVisible

 

priyanshp4_0-1793266224896.png

 

1 ACCEPTED SOLUTION

Sandesh Powar
Kilo Sage

Hi @priyanshp4 ,

You can achieve this by updating the existing Close Task UI Action condition on the Catalog Task (sc_task) table.

Steps to implement:

  1. Open the following UI Action record:

    SandeshPowar_0-1793357569219.png

     

  2. Append the following checks to the existing condition:

    SandeshPowar_2-1793357636258.png

     

    && !current.assigned_to.nil() && current.assigned_to == gs.getUserID()
  3. Save the UI Action and test it in Service Operations Workspace.

SandeshPowar_3-1793357718918.png

 

 

If you find this solution helpful, Mark this response as Helpful and Please Accept the solution.

Regards,
Sandesh Powar
ServiceNow Rising Star

View solution in original post

5 REPLIES 5

Tarun Rekandar
Giga Guru

Hi @priyanshp4,

You can hide the Close Task button on Catalog Task (sc_task) records in Service Operations Workspace. By adding the condition to the UI action.

current.state.canWrite() && current.approval != 'requested' && current.assigned_to.toString() != '' && current.assigned_to.toString() == gs.getUserID()

Approch:

TarunRekandar_2-1793362810184.png

 

Result:

TarunRekandar_0-1793362696445.pngTarunRekandar_1-1793362739749.png


Accept the solution if it assisted you with your question & Mark this response as Helpful.


Regards,

Tarun