How to create "Assign to me" UI action in both Platform UI and SOW in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Yakshitha ,
There is an OOTB UI action called "Assign to me " you can refer that.
Please check the link below
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
- 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
- Add Client Script to the Action
- Handle button click
- Call the server action
- Show success or error messages in Workspace UI
- 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
- (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..
