Not able to update catalog task state using custon ui action by end user

Sharath807
Tera Contributor

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?

15 REPLIES 15

@Sharath807 

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.

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

Sharath807
Tera Contributor

Hi @Anubhav24  The asset table is updating as expected .Only issue is with state field in sc_task form

Sharath807
Tera Contributor

@Ankur Bawiskar But for admin the state is updating.

@Sharath807 

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.

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

Anubhav24
Mega Sage
Mega Sage

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.