Trigger notifcation from worflow

avinashdubey103
Tera Guru

i have a requirement to trigger  a notification  using worflow 

To all the servicenowner of group BTG,IS,MIS,OCIO,Support, whose  active status is live .

I have written the following script , but it is triggering email to only 1 , it should trigger to all the service owners who fulfill the condition



 

Script :

var answer = [];

var gr = new GlideRecord("cmdb_ci_service");
gr.addEncodedQuery('u_business_unitINBTG,IS,MIS,OCIO,Support^install_status=300');
gr.query();

while (gr.next()) {
answer.push(gr.getValue("owned_by"));

}

//gs.log("Ayurveda" + answer);

1 ACCEPTED SOLUTION

Dibyaratnam
Tera Sage

How are you triggering the notification, can you share the snapshot of your workflow ? Also is your "answer" populating correctly in the log you have added?

 

View solution in original post

3 REPLIES 3

Dibyaratnam
Tera Sage

How are you triggering the notification, can you share the snapshot of your workflow ? Also is your "answer" populating correctly in the log you have added?

 

Please find the screenshot beelow

avinashdubey103_0-1702012775221.pngavinashdubey103_1-1702012817722.png

avinashdubey103_2-1702012847756.png

 

Can you set the answer to a hardcoded array by taking 2 3 sys ids from the log that you are getting just to check if it's being sent to those mentioned users/ groups or not. also don't declare the variable as var answer = [] as it's not needed.