Send Approval Request to Users with Role

Luke10
Kilo Expert

Hello Everyone,

I'm new to ServiceNow scripting and need some help. I have a custom role for approval changes. Only users with the 'change_approver' role should be sent the request approval.

When I go to the 'Approval Request' notification and 'Who will receive tab' there is not option for 'roles'. So, I'm missing something.

Does anyone know what I need to do? Any help would be appreciated.

Thanks!find_real_file.png

1 ACCEPTED SOLUTION

Luke10
Kilo Expert

I solved the issue. Turns out the code is correct. The workflow activity is for Approval Group. So, it didn't even look for user roles. The activity should have been Approval User. That fixed it. Thanks for everyone's help and advice.

View solution in original post

15 REPLIES 15

Tony Chatfield1
Kilo Patron

Hi, you might want to review the ServiceNow change documentation, before you make any wide sweeping changes to OOB functionality
The normal process is to add 'approvers' to the sys_approval table, individually or via an 'approval group'
and you should find this much easier to manage than approval via role

Approval notifications are triggered from sys_approval table (to the approvers) and the email processing (inbound action) of responses updates this table, which in turn updates the Change task.
If you use workflow, approval activities also manage behavior on rejection\approval.

I'd suggest checking out the change documentation and workflows in a dev instance.

I completely agree, but this task is being given to me by the architect. I don't have much say as to 'why' are we doing it this way.

Let's say there is a Network group with 5 users and does only 3 of them have change_approver role?

Are the roles assigned at user level rather than a group?

Service_RNow
Mega Sage

Hi,

user approver can be anybody based on the scenario.

 

For example in a catalog item request if you want the requester manager to approve user request before creating task we can use user approval tab in the workflow

with following line in the code

 

answer = [];

answer.push(current.requested_by.manager);

 

This will send approval to the manager.

 

This code will will refer to the manager field in the sys_user table and sends approval notification accordingly.

 

I hope this helps.

 

Please like or mark correct based on the impact of the response.