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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.