Approval from manager in flow designer based on particular category

Shweta Kasbe1
Tera Contributor

Approval from manager in flow designer.I am having one variable in catalog item as request_type inside that I am having few choices/category.

When user select project create and project modify then only he will ask for approval and the once approved it will create catalog task. Below are the ss attached Pls help me on this.

find_real_file.png

 

 
3 REPLIES 3

Brian Sorensen
Giga Guru

Are you using Flow designer for the workflow behind this?

Is the approver always going to be the same person?

 

If I am reading it right, on your flow you would want something like this

find_real_file.png

Your If would be Project Type is Create or Modify

then ask for approval - you can approve or reject when user approves / rejects. Hardcode in the user.

then if approved, created the catalog task

 

Does that make sense?

 

yes written script for approver

find_real_file.png

 
Also written script for this but still not working.
var a= fd_data.trigger.request_item.variables.request_type;
if(a == "Project Create")
{
gs.log('test'+fd_data.trigger.request_item.variables.request_type);
var arr = [];
var requested = fd_data.trigger.request_item.requested_for;
var user = new GlideRecord('sys_user');
user.addQuery('sys_id',requested);
user.query();
while(user.next()){
 arr.push(user.manager+'');
}
return 'ApprovesAnyU[' + arr+ ']' +'Or' +'RejectsAnyU[' + arr + ']';
}
 

 

Im not good with scripting
here is what I do, and what I think you want

 

If Statement in flow would look like this

find_real_file.png

 

Then you want the Requestor's manager to approve?

find_real_file.png

Then IF Approved

find_real_file.png

Create Catalog Task
find_real_file.png

 

Does that make sense?

Something else that we have started to do as a best practice is once we get catalog variables, we name the REQ.  

so I have this at the top of all my flows

find_real_file.png

 

This way your REQ will then have the short description of Request Type | Create or Modify etc