If a user is both requester and approver, and he is requesting for a change, problem, incident etc, then he must not be able to approve it.

shruthi29
Kilo Contributor

Hi all,

I have a scenario in my project, where if a user is having both requester and approver role, and a change request is raised by him/her, then he should not be able to approve it through

1)approval email he has received

2)Right click-> approve/reject button(from "Approvers" related list   on the change request form)

3)My approvals module on the application Navigator->click on approve/reject

Kindly help me implement this scenario.Any help or ideas is appreciated.

Thanks and Regards,

Shruthi

4 REPLIES 4

Chuck Tomasi
Tera Patron

Hi Shruthi,



If you simply deny them the ability to approve, you could have a lot of "stuck" requests/processes/workflows.



The logic should really be in the workflow or form (if there is an input for approver name) before the approval is generated. The secondary question is "What would you like to do if the user is the approver?" Reject it? Get their manager to approve it?


Hi Chuck,



Thanks for your reply!



As you suggested and we were thinking on same to avoid requester from approvers (before generating approvals).



,but in our case - all my workflows (problem, change, incident etc...) driving approvals with "Approval - Group" activities which are already in production.



As we know, "Approval - Group" activity in workflow allows us to specify only group ids and can't specify desired user(s) (after removing requester) as approvers.



(Since "Additional groups script"   in Approval - Group activity expecting group ids, we can't add filtered user ids).



can you please provide more information/help on filtering users (by removing requester) and adding these users as approvers in "Approval - Group" activity?



Thanks,


Pavan.


Thank you for the clarification.



Here's an idea. Implement this with a before business rule on the Approver table (sysapproval_approver) to do a check on the related record. You may have to write a switch statement based on the class (type) of related record to get the field.



For example, for a problem, you might need to compare the approver to field_a, for change request, it might be field_b.



If there is a match, throw an error message with gs.addErrorMessage() and do current.setAbortAction(true) to stop the submit process of the approval.



Reference:


Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki  


Hi Pavan,



Were you able to come up with a solution for this?   I'm looking to do the same thing to make sure that a user who submits a Change cannot be the same user to approve said Change.



Thanks