How do I send email notification to linked issue assignee

Omprakash Thamsetty
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 Leaders.
September 18, 2019

Hi,

I have Issue A with Links Issue B , Issue C and Issue D.

Issue B and Issue C are TASK

Issue D is Defect issue type.

 

Now I needs to send email to Issue D assignee when Issue A during transition. I am looking at script runner email notification but not finding the way to get Linked issue assignee in script runner email notification.

 

Looks to me I needs to have one scripted field that should hold Issue D assignee and then write the custom email notification during issue A transition.

Any advise.

 

1 answer

1 accepted

0 votes
Answer accepted
Ravi Sagar _Sparxsys_
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 Leaders.
September 18, 2019

Hi,

You need to use Send a custom email which is a Script Post-Function.

There is a similar example here. In the example instead of watchers just fetch the linked issue assignee.

Ravi

Omprakash Thamsetty
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 Leaders.
October 29, 2019

I used below piece of code

 

 def destinationIssue = it.destinationObject
if(destinationIssue.getIssueType().getName() == "Work Request"){
emailAddressTo = destinationIssue.assignee.emailAddress
if(emailAddressTo){
def strSubject = "APRA Story ${issue.key} has been moved to ReWork"
def strBody = """${issue.key} has been moved to Rework. Needs to work on WorkRequest ${destinationIssue.getKey()}"""
sendEmail(emailAddressTo, emailAddressesCC, strSubject, strBody)
}
Like Ravi Sagar _Sparxsys_ likes this

Suggest an answer

Log in or Sign up to answer