We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Users should not be able to approve their own requests

AparnaUttaG
Tera Contributor

Hello Team,

 

Can anyone suggest how to achieve this requirement?


If the approver = created by user(Requested for) then they should not be able to approve the request.

1 ACCEPTED SOLUTION

Here is a BR that I think will do the job.

 

Condition: current.source_table  ==  'sc_req_item' && current.sysapproval.opened_by ==  current.approver


Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	
	current.approver = current.approver.manager;
	current.comments = 'Approver is also Requester - Moved to Manager';

})(current, previous);

 

It was modified from a BR that I've used to auto-approved if Requester is also Approver. I haven't tested it.

 

Regards,
Niklas

View solution in original post

10 REPLIES 10

VishalB06557037
Giga Sage

Hi @AparnaUttaG 

 

You can divert the process in workflow.

E.g., 

If requestor is itself an approvar then skip the approval activity else

Go to approval activity.

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates