How to create "Assign to me" UI action in both Platform UI and SOW in servicenow

Yakshitha
Tera Contributor

I have a requirement to create UI action "Assign to me" in both platform UI and SOW and it should check the if logged in user is part of current assignment. If yes. then assign the catalog task to the user otherwise show error message.
I have created UI action for platform UI and its working fine. But how to create UI action for SOW?

@Ankur Bawiskar 

2 REPLIES 2

Bhavya11
Kilo Patron

Hi @Yakshitha ,

 

There is an OOTB UI action called "Assign to me " you can refer that.

Please check the link below

https://yourinstance.service-now.com/sys_ui_action_list.do?sysparm_query=nameSTARTSWITHassign%20to%2...

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK

AnkaRaoB
Kilo Guru

Hi @Yakshitha , 

 

Classic UI Actions work only in the Platform UI and are not supported in Service Operations Workspace (SOW).
To implement an  Assign to Me action in SOW, you must create a Workspace Declarative Action using the Now Experience framework.

This approach ensures the action:

  • Appears in SOW
  • Validates whether the logged-in user is part of the assignment group
  • Assigns the catalog task to the user if valid
  • Displays an error message if the user is not a group member

 

Follow the below steps

  1. Create a Declarative Action
    • Navigate to: Now Experience -Actions -Declarative Actions
    • Click New
    • Set:
      • Table: sc_task
      • Action type: Record
      • Workspace: Service Operations Workspace
      • Name: Assign to Me
  2. Add Client Script to the Action
    • Handle button click
    • Call the server action
    • Show success or error messages in Workspace UI
  3. Add Server Script
    • Get the logged-in user
    • Check if the user is a member of the current task’s assignment group
    • If yes, set assigned_to to the user and update the record
    • If not, return an error message
  4. (Best Practice)Use a Script Include
    • Move the assignment and validation logic into a Script Include
    • Reuse the same logic for:
      • Platform UI Action
      • Workspace Declarative Action
    • This avoids duplicate code and ensures consistent behaviour
  • If my response helped mark as helpful and accept the solution..