Approval Chains

Brian_Scott
Kilo Contributor

we have a requirement to gather approvals for all managers up to a certain point.

I have tried creating an IF -> Approval User loop in the workflow, but I've noticed two things. 1) the if statement isn't working after the first check, and 2) the approval user activity isn't generating new approvals after the first one. Or it's deleting the previous approvals associated to it.

Any ideas how I should implement this?

13 REPLIES 13

Daniel Oderbolz
Kilo Sage

Can you post the exact code you are reffering to?

My feeling is that you need the sys_id instead of the name.

Best
Daniel


If this answer was helpful, I would appreciate if you marked it as such - thanks!

Best
Daniel

brittanyg_
Kilo Expert

I've attached a picture of the portion of the workflow in question. the flow seems to be working except for the last approval where it loops back to the IF statement. The code I have is below:

 

var grUser = new GlideRecord('sys_user');
grUser.get(workflow.scratchpad.current_manager);
var answer = [];
answer.push(grUser.manager.name);
workflow.scratchpad.current_manager = grUser.manager.sys_id;

 

Right now it skips the approval, loops back to the if but gets stuck because there is no user to assign the approval to.

brittanyg_
Kilo Expert

Any ideas on a fix for my script? I'm at a loss here.

Its very hard to say, based on the clipping you posted.

Are you shure the If statement evaluates to "No"? (I assume this is the branch where your second approval kicks in).

Also, you want to be careful: is it OK if your CEO suddenly gets approvals?

We use a function here to limit the level of the approving manager to some maximimum.

Best
Daniel


If this answer was helpful, I would appreciate if you marked it as such - thanks!

Best
Daniel