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

Erik Nelson
Kilo Sage

Hi, Jean-Paul,

Yes, you can create a new notification triggered off a Demand being moved into Submitted state (or in general just being created). Out of the box, it looks like Portfolio only has the Portfolio Manager field, however if you add a custom "List" field, looking at the User [sys_user] table, you can populate that with your list of Stakeholders and call it for sending the notification. That also means, you can easily maintain your list of Stakeholders at the Portfolio level.

Erik

Maharshi Chatte
Kilo Guru

Hi,

If the list of users(stake holders) are already defined then you just need to add them in the whom to send section of the notifications. 

find_real_file.png

In the marked field you can add the field you want and emails will be triggered based on the condition you are giving.

Please mark my answer as helpful/correct if it was useful to you.

Regards,

Maharshi

Hi Maharshi

Thanks a lot but I can't find "Stakeholders" in the possible values listed in the "Users/Groups in field" field. And I don't want to enter manually the name of the list of people ( same list of any demand related to the same portfolio). Did I miss something ?

Thanks, Jean-Paul

Mahendra RC
Mega Sage

Hello Jean,

Yes you can do that by creating a Business rule dmn_demand table as shown below:

(function executeRule(current, previous /*null when async*/) {
	var demandStakeHolders = [];
	var demandPortfolio = current.getValue("portfolio");
	var demandStakeholderGR = new GlideRecord("dmn_stakeholder_register");
	demandStakeholderGR.addEncodedQuery("sys_class_name=dmn_stakeholder_register^active=true^portfolio=" + demandPortfolio);
	demandStakeholderGR.query();
	while (demandStakeholderGR.next()) {
		demandStakeHolders.push(demandStakeholderGR.getValue("user"));
	}
	if (demandStakeHolders.length) {
		gs.eventQueue("demand.stakeholder.email", current, demandStakeHolders.join(","), "");
	}

})(current, previous);

You have to create event with name as demand.stakeholder.email table as dmn_demand in sysevent_register table

Create a notification that will be fired when this event is triggered from BR in When to Send tab:

find_real_file.png

on Who will receive tab 

find_real_file.png

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

Thanks