Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,109
Community Members
 
Community Events
176
Community Groups

Scriptrunner listener trigger on "issue updated" does not work when story attached to epic

Edited

Hey,

I want to trigger a listener each time an epic is updated, specifically when a story is added to the epic via the "epic link" field.

(The end goal is to fill a "bigger sprint" field based on the stories' biggest sprint within the epic).

Seems like setting the epic link of a story does update the "updated date" of the parent epic but for some reason, this does not trigger the listener.

Any way to work around that? Am I doing something wrong?

For know the workaround I do is to basically empty the field on a scheduled basis, which of course completely clutters the issue history.

Thanks.

 

image.pngimage.pngimage.pngimage.png

1 answer

2 votes

This is an annoying one, but something that makes sense if you look at it from the point of view of the people who are given a story to implement in Jira, without fully understanding the wider picture.

Listeners work off events, and "issue updated" events are only fired by changes to issues.  When they are, the event contains a pointer to the issue that has been changed.  

Now, in this case, when you are updating links, you are only changing the child issue - the Epic link only exists on the child.  Despite the fact that the Epic effectively gets updated as well, there's not technically any change to the Epic, so no event is fired. 

The change of updated date on Epics when they gained or lost stories was a "nice to have" feature that Atlassian implemented ages ago (there was a time when adding issues to an Epic appeared to have no effect on the Epic at all), but it was done in a minimal way, without looking at the actual problem it should have been solving - i.e. exactly what you've got here!

What you should do is create a listener that listens for the child issues having an Epic link set, and read that as the trigger for the rest of your script.

Great explanation Nic! Thanx for that info! 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS

Atlassian Community Events