Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Trying to send email notifications to Demand Stakeholders when project state changes

Mike Stockman1
Tera Guru

I'm trying to send email notifications to the stakeholders when a project state changes but am not getting any notifications to go to the Stakeholder. If i add myself to the User, I get a notification.

I'm using the 'dmn_m2m_demand_stakeholder' table and have tried the following configurations.

I've tried setting When to send in these 2 manners but have no change in result:

When to send:

  • Send when: even is fired
  • Event name: pm_project.updated
  • Conditions: Updated is anything

And I've tried:

When to send:

  • Record inserted or updated
  • Conditions: Demand.Project.State changes

Who will receive:

Users/Groups in fields: Stakeholder

What it will contain:

  • PROJECT CREATED STAKEHOLDER -- ${stakeholder.user.name}
  • Stakeholder User: ${stakeholder.user}
  • Stakeholder User Email: ${stakeholder.user.email}
  • Stakeholder: ${stakeholder}

Thanks for any guidance!

1 ACCEPTED SOLUTION

You have to use Mail Scripts for that


http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0



find_real_file.png



If you see in the script I have current project record, I can write a logic to get all stakeholders email using simple joins.



Now in the Notifications I do the following



find_real_file.png




In the message text - notice that I am doing ${mail_script: send_mail_to_stake_holder} which would be my mail script


In the Who will receive tab, give some default address for the TO.


Stakeholders will be added in the CC of the email, as you can see email.addAddress in line 9 of the script


View solution in original post

6 REPLIES 6

Hi Mike,



I am new to the mail scripting part of ServiceNow. We are trying to do the same thing but instead send the stakeholders an email when the Demand state changes.



Would you mind sharing the full script you used?



Thanks


Hi Karlie,

Let me know if you got any solution for your request with regards to demand.

Please share the solution if you find the best approach to send notifications.

Thanks