Not able to update catalog task state using custon ui action by end user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 11:33 PM
I created a custom ui action in sc_task form with some logics, including updating the state field to closed complete on clicking it. But it works as expected if the user has admin role. But when agents( who has no admin role) clicks other logics are working but state is not getting closed completed in sc task form. Any help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 12:12 AM
means some business rule is blocking the update
try to find that and it seems that BR is running only when button is clicked
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 12:12 AM
Hi @Anubhav24 The asset table is updating as expected .Only issue is with state field in sc_task form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 12:18 AM
@Ankur Bawiskar But for admin the state is updating.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 01:48 AM
any data policy or before update business rule did you check?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:39 AM
Hi @Sharath807 ,
1)Try enabling the script tracer and then perform your actions to see if any BR is restricting the action.
2)Also instead of current.sys_id either user getUniqueValue or add toString() after sysid.
3)Also for update statement you should try below error handling to see why it is failing in case there is an error occurring during update of task table:
if(grTask.update() === null)
{
gs.error(grTask.getLastErrorMessage());
}
Please mark correct/helpful if my response helped you.