The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I trigger an email when an epic is moved to "closed"?

chris yates
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2018

I want to trigger an email to a specified distro list when an epic is moved to "closed" status.  Ideally I would like that email to include specific fields from the JIRA ticket such as the "Description" field.  It may be excessive to do this with all epics so it would be best if there was a choice to send and email or not when you close the ticket.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 13, 2018

Hello,

You would need an add-on for it. You could use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

You could create a new custom field of the check box type, called "Send email". Then add a screen for the transition, which leads to the Closed status, with the Send email field included. Then you add a post function to this transition, which would check if the Send email field is on or off. If it is on, this post function would send a email.

The code for the post function would look like this:

if (#{Send mail} == "Yes") {

  string [] to = {"testJiraUser1", "testEmail@kepler.ro", "testJiraUser2"};
string [] cc = {"testEmail2@kepler.ro"};
sendEmail("testFrom@kepler.ro", to, cc, "testSubject.tpl", "testBody.tpl");

}

You can find more info on sendEmail function here:

https://confluence.cprime.io/display/SIL/sendEmail