Trigger approvals to group members using script

Pallavi65
Tera Contributor

Hello everyone,

Hope you all doing good.

In a workflow I have already a Approval user activity where I have written script like if the standard change template version is this, then i am pushing approvals using answer.push for different users. 

But here i want to trigger the approvals for 2 different change templates to the Assignment group members where the end user selects the group in the Assignment Group field on the change form.

So, without using another Approval Group activity in the workflow, can I write a script in the Approval User activity to trigger to the members of the Assignment Group that was selected in the change form?

 

Please provide me a solution

 

 

REgards,

Pallavi

3 REPLIES 3

Sourabh26
Giga Guru

Share the screenshots of your workflow activity and workflow

suvro
Mega Sage
Mega Sage

you can script like below

var answer = [];

var grGRM = new GlideRecord('sys_user_grmember');

grGRM.addQuery('group' , current.assignment_group);

grGRM.query();

 

while (grGRM.next()){

answer.push(grGRM.user.toString());

}

Pallavi65
Tera Contributor

Hi Suvro,

 

Thank you. Will check and get back

 

 

Regards,

Pallavi