- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 10:24 AM
Hi,
I'm trying to send a project status report to stakeholders who have a vested interest in the project. I created an email notification using the Project [pm_project] table it sends a link to the Status Report to the user on update and insert. I am able to add myself as a user and get the notification but cannot add stakeholders to the "Who will receive" because its not a field directly on the project but is only in the related lists section at the bottom of the project module. (It doesn't show as a field in "Users/Groups in fields" but when I do a Configure -> Related Lists on the project it shows there). At least that is what I perceive to be the problem (I'm 3 weeks new to Servicenow).
I did see this post:
https://community.servicenow.com/community?id=community_question&sys_id=a83d07a9db9cdbc01dcaf3231f9619f8
Will this work for me? Is there any way to get the stakeholders to appear in the "Who will receive"?
Any help is appreciated.
Thanks
This is my project (stakeholders is in a tab in the bottom section):
Here's the notification I set up:
Solved! Go to Solution.
- Labels:
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2019 09:27 AM
Try doing this ...
var sh = new GlideRecord('pm_m2m_project_stakeholder');
sh.addQuery('project',current.sys_id);
sh.query();
while (sh.next()) {
email.addAddress('cc',sh.stakeholder.user.email);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 10:27 AM
Yes, the community post you linked will work for you. No, you can't get stakeholders in the "Who will receive" because they are on a different table that is referencing the project record and you can't dot-walk that direction. You need to use a mail_script to grab all of the stakeholders and add them as cc users to the notification. The piece that the other article is missing is the logic to grab the stakeholders. Let me know if you need help with that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 10:35 AM
Thank you, I'll give it a shot. I may need to take you up on that. I appreciate your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2019 08:55 AM
Hi Tim,
The following script (attempt) represents what I'm trying to achieve. I'm wanting to get the stakeholders associated with a project and email them the link to the project "Status Report" page when an update or insert occurs on a project. I know the script is incorrect but just wanted to show my objectives for the script. I haven't succeeded in getting my breakpoints to work either. I appreciate any advice you can provide. Thanks, Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2019 09:27 AM
Try doing this ...
var sh = new GlideRecord('pm_m2m_project_stakeholder');
sh.addQuery('project',current.sys_id);
sh.query();
while (sh.next()) {
email.addAddress('cc',sh.stakeholder.user.email);
}