workflow script for approval of given application owner approval

suresh51
Tera Contributor

find_real_file.png

Hi guys,

pls help i need to script for  application owner approval 

1 ACCEPTED SOLUTION

Are the field names correct? can you check if the application has business owner mapped? if yes also verify if owner is active or not.

keep log and verigy the values 

gs.info("business owner: "+current.variables.application.u_business_owner.toString());
answer =[];
answer.push(current.variables.application.u_business_owner.toString());

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

15 REPLIES 15

Then, use the below code simply.

 

var Req = current.variables.request_for;

var techapr = current.variables.application.u_business_owner.toString();

 if (techapr[i] != Req)

{

answer.push(techapr);


}

//Answer variable can't take true false value here.

 

 

Not working

Use this. Sorry for the typo. Please user below one.

 

//I hope you want to skip the approval if the requestor for is the owner right?

// Please change the variable names as per your name.

 

Then, use the below code simply.

 

var Req = current.variables.request_for+"";

var techapr = current.variables.application.u_business_owner+"";

 if (techapr!= Req)

{

answer.push(techapr);


}

//Answer variable can't take true false value here.

Nayan Mahato
Tera Guru

Hi Suresh,

In the approval user activity, you have to push the business owner value in the answer variable shown in the below screenshot.

find_real_file.png

 

 

Regards,

Nayan

Voona Rohila
Kilo Patron
Kilo Patron

Hi suresh

Is business owner field type reference?


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP