Auto approve catalog requests when the requestor is either a director, a VP or CEO

akriti2
Kilo Contributor

Hi all,

I have a question. Our requirement is that when a user orders a catalog item, the request is auto approved and the requested item records (RITM''s) are sent to the appropriate users for approval. This is fairly simple and has been configured. Now the requirement is that if the requestor is either a CEO, VP, SVP, Director then the requested item records(RITM' s) should be auto approved. They shouldn't go to an approver. The status of the RITM should automatically be set to order fulfillment and the fulfiller groups will works on their tasks and the requestor will receive his ordered item. Other users will go through the approval process. How do I configure the workflow for auto approvals based on the title of the users. Any help would be great!

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



You can create "If activity" in the workflow and place it before "Approval activity" with the script as. Modify it as per your req.


answer = ifScript();




function ifScript() {


  if (current.request.requested_for.title == "Director" || current.request.requested_for.title == "VP" || current.requested_for.title == "CEO") {


  return 'no';


  }


  else{


  return 'yes';


  }


}






Please let me know if you have any questions.


View solution in original post

4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



You can create "If activity" in the workflow and place it before "Approval activity" with the script as. Modify it as per your req.


answer = ifScript();




function ifScript() {


  if (current.request.requested_for.title == "Director" || current.request.requested_for.title == "VP" || current.requested_for.title == "CEO") {


  return 'no';


  }


  else{


  return 'yes';


  }


}






Please let me know if you have any questions.


Thank you so much pradeepksharma!! Works perfectly. Just made a small change.


Instead of current.requested_for.title used current.request.requested_for.title


Excellent. Thanks for participating in the community!


In the "If activity" what stage will it be in? I'm trying to automatically approve request done by VP, CEO, DIR. Otherwise it would go to the user's who put the request in, their manager.

 

find_real_file.png