Forums

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

Is there a way we can get a notification if a story is added to an Epic

Matthew Ford March 19, 2019

I am not familiar with this scripting

Can someone help me with:

create a scriptrunner listener for an "issue created" event,

and in the listener
check if there is an "Epic-Story Link" type link, if yes
get the Epic linked to the issue
get the watchers of the Epic
send a mail to these watchers

1 answer

1 vote
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2019

Hello Matthew,

I hope you are having a nice day.

I'm not sure on how you can perform such automation with Scriptrunner plugin, however, I'm aware of some solutions which do not require any codes.

I understand that you would like to send an e-mail notifying all the Epic watchers when it gets linked to a Story. Is that correct?

If i got it right, I would like to suggest you try Automation for JIRA plugin. You can simply customize the automation below to achieve your need:

Screen Shot 2019-03-19 at 18.22.41.png

Here's the background of the rule configured above:

- When the issue is created, the automation triggers and check if it has any Epics linked to it

- If it has, it will send a notification for all Epic watchers

P.S: Use the Smart value {{issue.watchers.emailAddress}} to reference the e-mail address of your Epic watchers.

Let me know if this information helps!

Matthew Ford March 21, 2019

That plugin costs 3300 dollars.  And we already have Scriptrunner

Matthew Ford March 21, 2019

I was given this answer:

def issue1 = event.getIssueLink().getSourceObject()
def issue2 = event.getIssueLink().getDestinationObject()

issue1.getIssueType().getName() == "Epic" && issue2.getIssueType().getName() == "Story"

 

But this is not working. 

 

Getting this error:

2019-01-14 16:57:40,514 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2019-01-14 16:57:40,514 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.link.IssueLinkCreatedEvent, script: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail
java.lang.IllegalArgumentException: The issue object was not available in the binding, perhaps called from an event handler with a non-issue event
 at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.doScript(SendCustomEmail.groovy:517)

Suggest an answer

Log in or Sign up to answer