Approval from Variable which is reference to sys_user

Chad Wilhelm1
Tera Expert

Hello,

I am trying get approval sent to manager of reference field variable and I have tried everything.   I have approval user activity.  

I have tried

answer[];

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

This below as well

answer = [];
if(curent.variables.saowner)
{
var saownermanger = new GlideRecord('sys_user');
if(saownermanager.get(current.variables.saowner)){
answer.push(saownermanager.manager);
}
}

Everytime it says skipped.    Do I need an if activity to check to make sure saowner is not null which it can never be since is required.    Also I checked to make sure the user had a manager and they do.

 

Any assistance is appreciated.

Thanks,

Chad

1 ACCEPTED SOLUTION

I don't see any issue with your script. Also make sure the manager's account is active.

 

Can you try

 

answer='';

if(curent.variables.saowner)
{

answer=current.variables.saowner.manager.toString();

}


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

You are on the right track by checking for a null value first.

 

answer = [];
if(curent.variables.saowner)
{
   var saownermanger = new GlideRecord('sys_user');
   if(saownermanager.get(current.variables.saowner)){
      answer.push(saownermanager.manager);
   }
}

Are there any indications in the system log of what might be going on?

Have you tried using a gs.info() statement or two to confirm the variables contain what you think they do?

SanjivMeher
Kilo Patron
Kilo Patron

Are you running this workflow on Request table or Requested item table. if it is running on Request table, you will have to query the Requested Item table to get the variable.


Please mark this response as correct or helpful if it assisted you with your question.

Requested Item.   Thanks.

I don't see any issue with your script. Also make sure the manager's account is active.

 

Can you try

 

answer='';

if(curent.variables.saowner)
{

answer=current.variables.saowner.manager.toString();

}


Please mark this response as correct or helpful if it assisted you with your question.