Publication Workflow Approval Scripting

CesarV_
Tera Contributor

Hello. 

 

I am trying to update a publication workflow activity to dynamically assign the Publication creator's manager from the sys_user table as the approver.

 

I have had no luck in my configurations or getting the script right, any advice would be greatly appreciated. 

 

Script:

var creator = current.sys_created_by;
var userRec = new GlideRecord('sys_user');
userRec.addQuery('user_name', creator);
userRec.query();

if (userRec.next()) {
    var manager = userRec.manager;
    current.approver = manager;
}

 

 

Workflow Activity Configuration:

CesarV__0-1750089417024.png

 

 

CesarV__1-1750089436707.png

 
 

CesarV__2-1750089460677.png

 

 

0 REPLIES 0