Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to send approval to the group from workflow??

KM SN
Tera Expert

I need to send approval to the group which is mentioned in the variable but if you can see first I am manually approving but the 2nd approval is automatically completing without asking for approval.

I tried with current.variables.tower also where without mentioning sys_id  but no use. can I get any help over here?

even gs.log also not working?


ts-1.pngts-2.png

2 ACCEPTED SOLUTIONS

Kris Moncada
Kilo Sage

Hi @KM SN ,

 

Please try the following:

  • If you are developing a scoped application, try gs.info to log messages.
  • The second approval is most likely "approving automatically" because script is not providing a valid Sys ID. If current.variables.tower is referencing the sys_user tabletry using current.variables.tower.toString() instead.

Hope this helps.

View solution in original post

Najmuddin Mohd
Mega Sage

Hi @KM SN ,
I believe syntactically, current.variables.tower is correct.

Possible scenario where the approval automatically is if there are no users in the group you selected.

 

Can you try once by hardcoding the sys_id of a group and check whether it is working.

If this information helps you, kindly mark it as Helpful.

Regards,
Najmuddin.

View solution in original post

2 REPLIES 2

Kris Moncada
Kilo Sage

Hi @KM SN ,

 

Please try the following:

  • If you are developing a scoped application, try gs.info to log messages.
  • The second approval is most likely "approving automatically" because script is not providing a valid Sys ID. If current.variables.tower is referencing the sys_user tabletry using current.variables.tower.toString() instead.

Hope this helps.

Najmuddin Mohd
Mega Sage

Hi @KM SN ,
I believe syntactically, current.variables.tower is correct.

Possible scenario where the approval automatically is if there are no users in the group you selected.

 

Can you try once by hardcoding the sys_id of a group and check whether it is working.

If this information helps you, kindly mark it as Helpful.

Regards,
Najmuddin.