
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 04:44 PM
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:
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 12:24 AM
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.
2. Then come to the Fire Event step.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 12:24 AM
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.
2. Then come to the Fire Event step.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 12:29 AM
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]
****************************************************************************************************************