Restricting manual approvals to specific users

mike_m35
Tera Contributor

Hello, I'm looking to restrict the manual approval options to only users with the role of "approver_user". Currently, when we manually add a new approval it shows the entire list of users which is causing errors and the directive has been changed to "don't show anyone who shouldn't be approving". 

 

 

It appears as though people suggested copying and overriding the "Edit" UI Action on the page, but as I was looking at it, I'm not entirely sure where I would update the script or what it would contain. Any help or suggestions would be greatly appreciated, thanks! 

 

Edit UI Action for reference:

mike_m35_0-1708985601743.png

 

1 ACCEPTED SOLUTION

Rutuja Khalate
Tera Guru

Hi @mike_m35 ,

 

You can add this 'roles=approver_user' in the below line

uri.set('sysparm_query', 'roles=approver_user'); depends on your requirement.
If you don't have a requirement to restrict for 'cmdb_data_management_task' table then you can only modify the line number 18 in your screenshot.

Please mark this response as correct or helpful if it assisted you with your question.

Best Regards,
Rutuja Khalate

View solution in original post

3 REPLIES 3

Rutuja Khalate
Tera Guru

Hi @mike_m35 ,

 

You can add this 'roles=approver_user' in the below line

uri.set('sysparm_query', 'roles=approver_user'); depends on your requirement.
If you don't have a requirement to restrict for 'cmdb_data_management_task' table then you can only modify the line number 18 in your screenshot.

Please mark this response as correct or helpful if it assisted you with your question.

Best Regards,
Rutuja Khalate

Thank you! This did exactly what we needed, for those who may come across this later, I was able to add additional queries into this to limit not only on the approver_user role but also matching company fields. The updated query is now:

'roles=approver_user^company=javascript: current.company'
 
Thanks again! 

rajamma
Tera Contributor

Hello @Rutuja Khalate 

we have same requirement we need to restrict specific group member and 4 levels of that group could you please let me know how we can achieve this.

we have tried business rule but it is not working as expected.