How do I use a services user list to send a notification to all of them?

Bidduam
Tera Guru

So what I want to do is I thought somewhat simple and it might be, but not for me currently lol

 

I have a list of services, each service has a bunch of users associated with each one. What I want to be able to do is to send an email notification to the list of users for whichever service has been selected.

 

I have a catalog item with a reference field called u_service which is using the cmdb_ci_service table. I want the notification to send at a point in the flow to all users associated with the selected service.

 

This is what I mean by users associated:

Bidduam_0-1721951027503.png

 

 

Anyone able to help me please, with actual instructions for my exact situation - I've looked at different forum chats already and found a heap, none of them are exactly what I want to do and I can't adapt them to do what I need either.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Hi @Bidduam 

My above approach is for scripting part. You can refer to below for flow designer in your scenario.

1. Firstly, there should be a step to get catalog variable.

Timi_0-1722237580380.png

 

2. Then come to the Fire Event step.

Timi_1-1722237682554.png

 

Script

var service = fd_data._1__get_catalog_variables.u_service_affected; //call your variable from the 1st step
var users = [];
var gr = new GlideRecord('m2m_sp_status_subscription'); //your relationship table
gr.addQuery('cmdb_ci_service', service);
gr.query();
while(gr.next()){
	users.push(gr.getValue('sys_user'));
}
return users;

 

Cheers,

Tai Vu

View solution in original post

6 REPLIES 6

Hi @Bidduam 

My above approach is for scripting part. You can refer to below for flow designer in your scenario.

1. Firstly, there should be a step to get catalog variable.

Timi_0-1722237580380.png

 

2. Then come to the Fire Event step.

Timi_1-1722237682554.png

 

Script

var service = fd_data._1__get_catalog_variables.u_service_affected; //call your variable from the 1st step
var users = [];
var gr = new GlideRecord('m2m_sp_status_subscription'); //your relationship table
gr.addQuery('cmdb_ci_service', service);
gr.query();
while(gr.next()){
	users.push(gr.getValue('sys_user'));
}
return users;

 

Cheers,

Tai Vu

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Bidduam 

 

Give a try to Targeted communication module of ServiceNow.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************