Is it possible to send an Email notification to a predefined list of people (by portfolio) when a demand is submitted ?

J-Paul Millet
Mega Guru

My users would like a predefined list of people to be notified when a Demand is submitted. This default list is defined by Portfolio.I was thinking about using the defined stakeholders. Is it possible to configure the tool so that the Stakeholders are notified when a demand moves to submitted ? if yes, how to do it ? If not, what could be the workaround ? What is the best practice to deal with this kind of need ?

Thanks, Jean-Paul

1 ACCEPTED SOLUTION

Hello @Jean-Paul Millet 

Just wanted to check with you, if the above response answered your question. If yes, then please do close this thread/question by marking the appropriate response as correct.

If you still need any further help or guidance on this then please update those on this question.

Thanks

View solution in original post

8 REPLIES 8

Hi Mahendra,

Thanks a lot. I have 2 questions:

1- In your Business Rule , it seems the notification is based on the stakeholder list defined at the Portfolio level. Not the list captured in the demand stakeholder related list. correct ? I need something based on the 2nd option

2- Why not creating a standard Notification based on the dmn_m2m_demand_stakeholder table  instead of a BR ?

Thanks, JP

Hi Mahendra, Thanks but

1- does it mean it's impossible to use the "Notifications" capabilities based on the dmn_demand  or dmn_m2m_demand_stakeholder tables ?

2- in your proposal the notification is sent to the stakeholders mentioned at the Portfolio . not the ones in the demand related table . Correct ?

Thanks again, Jean-Paul

Hello Jean-Paul Millet,

Please find the below comments for your questions:

1- In your Business Rule , it seems the notification is based on the stakeholder list defined at the Portfolio level. Not the list captured in the demand stakeholder related list. correct ? I need something based on the 2nd option --> yes you can do please refer below script

2. Why not creating a standard Notification based on the dmn_m2m_demand_stakeholder table  instead of a BR ? --> You have to send the notification when the demand is submitted so If you create a notification on dmn_m2m_demand_stakeholder table then we will not be able to monitor the demand record when it is getting submitted. If the stakeholder on demand related list once the demand is submitted then we can do. But then the separate notification will be sent to each stakeholder

1- does it mean it's impossible to use the "Notifications" capabilities based on the dmn_demand  or dmn_m2m_demand_stakeholder tables ? --> we are trigger the email on dmn_demand table.

(function executeRule(current, previous /*null when async*/) {
	var demandStakeHolders = [];
	var demandGuid = current.getUniqueValue();
	var demandStakeholderGR = new GlideRecord("dmn_m2m_demand_stakeholder");
	demandStakeholderGR.addEncodedQuery("demand=" + demandGuid);
	demandStakeholderGR.query();
	while (demandStakeholderGR.next()) {
		demandStakeHolders.push(demandStakeholderGR.getValue("stakeholder"));
	}
	if (demandStakeHolders.length) {
		gs.eventQueue("demand.stakeholder.email", current, demandStakeHolders.join(","), "");
	}
})(current, previous);

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

 

Hello @Jean-Paul Millet 

Just wanted to check with you, if the above response answered your question. If yes, then please do close this thread/question by marking the appropriate response as correct.

If you still need any further help or guidance on this then please update those on this question.

Thanks