dot walking in workflow using script

RudhraKAM
Tera Guru

I have a requirement where if the Organizational type is division then the manager will be the approver of the change if the organizational

type is not division then it should check the parent group , it should continue until the organizational type is division and then the manager of that group should be approver of the change 

 

Can some one help me with the script 

find_real_file.png

 

find_real_file.png

 

find_real_file.png

 

In this example first it will check the assignment group and see if the type is division or not if not it should check for the parent in that group and see for the organizational type ,, 

 

I am stuck with the scripting part in the approval user activity in workflow 

 find_real_file.png

1 ACCEPTED SOLUTION

RudhraKAM
Tera Guru

 

This fixed my issue after making some changes 

 

var manager = groupOrg(current.assignment_group);
answer = [];
answer.push(manager);


function groupOrg(groupObj){
if(groupObj.u_organizational_type == 'division'){
return groupObj.manager.toString();
}
else if(groupObj.parent != '') {
return groupOrg(groupObj.parent);
}
return;
}

View solution in original post

13 REPLIES 13

RudhraKAM
Tera Guru

Both of the solutions are not displaying the accurate results 😞

Can you post your results along with what you are expecting to see

I edited my response to you, so you might have to try the updated version. I tested this same logic on my environment and it correctly grabbed the manager. Have you tried running a similar version of this script in a background script for testing output?

Throw some workflow.info logging messages in the script to see what values are being found throughout the script.

RudhraKAM
Tera Guru

 

This fixed my issue after making some changes 

 

var manager = groupOrg(current.assignment_group);
answer = [];
answer.push(manager);


function groupOrg(groupObj){
if(groupObj.u_organizational_type == 'division'){
return groupObj.manager.toString();
}
else if(groupObj.parent != '') {
return groupOrg(groupObj.parent);
}
return;
}