Line manager

nameisnani
Mega Sage

Hi Team ,

 

Can anyone please me in Workflow , 

 

nameisnani_0-1709620199159.png

 

 

For every - option we have to give line manager approval , and for each option 2nd level approval is different , 

 

I have stuck here , If I give line manager , and workflow will be big . . . . . workflow maintenance is very tough , 

 

how should we proceed with approvals . 

 

nameisnani_1-1709620198844.png

 

 

Can anyone please help ...... me help me here with steps . 

 

Can anyone please help how can we reduce adding line manager for every option .

 

Thanks in advance 

6 REPLIES 6

Hi @Sohithanjan G  @Sohail Khilji 

 

For every option , Line manager Approval is needed , after line manager , the  2nd level is differenet based on options in the list . 

 

How should i proceed here .

@nameisnani 

 

  • Step 1: Create an activity of Approver User with this script below

 

 

answer=[];

answer.push(current.variables.requested_for.manager);

 

 

  • Step 2:  Add the another approval user activity with below script

 

 

answer = [];
// Define a mapping of Azure file names to approval groups
var azureFileToGroupMap = {
    "FS Support": "AFS_FS_IT_SUPPORT",
    "FS Corporate Action": "AFS_FS_CA" 
};

// Query the sys_user_group table based on the mapped approval group
var approvalGroup = azureFileToGroupMap[current.variables.azure_file];
if (approvalGroup) {
    var groupGr = new GlideRecord('sys_user_group');
    groupGr.addQuery('name', approvalGroup);
    groupGr.query();    
    if (groupGr.next()) {
     answer.push(groupGr.sys_id);
     }
}

 

 

🙂

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)