We use Epics like one would normally use components. We use Epics in this fashion so we can use the left hand drag and drop functionality, easy sorting and ranking in the JIRA Agile planning board.
However some users are having a hard time tracking when issues are added to their given epic. Using JQL and a saved query I can track when a new issue is created within the epic at the point of issue createion. However I cannot figure out a way to track issues initially created outside the epic and then added to the epic later on.
Any ideas?
Thanks in advance.
I don't believe its possible per se. Take a look at this https://jira.atlassian.com/browse/GHS-10570...
When issues get added to an epic, only the added issues are changed. We add a change item to the epic, but this does not trigger an issue update event for the epic. We don't plan on adding this in the near future.
You can use the epic report to see what has changed for the epic.
In case anyone runs in to this again, the scriptrunner IssueLinkCreated/IssueLinkDeleted catches these events.
To verify that its an epic link that was updated, you can check: event.issueLink.issueLinkType.name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Anders Lantz Do you have any example scripts you can share that use those events. i can only find bits and pieces and can't get them to work, so I'm hoping I'm missing something simple.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use ScriptRunner event listner, and set it to listen for link deleted and created, then I use the following code to determine if its an epic link.
if ([IssueLinkDeletedEvent, IssueLinkCreatedEvent].contains(event.getClass())) {
log.debug("Issue link event")
if (event.issueLink.issueLinkType.name == "Epic-Story Link") {
log.debug("Epic link event")
log.trace("Destination Issue:" + event.issueLink.destinationObject)
log.trace("Source Issue:" + event.issueLink.sourceObject)
log.trace("Link Type:" + event.issueLink.issueLinkType.name)
if (event instanceof IssueLinkDeletedEvent) {
log.debug("Link deleted")
} else if (event instanceof IssueLinkCreatedEvent) {
log.debug("Link created")
}
}else {
log.debug("Link type:" + event.issueLink.issueLinkType.name)
log.debug("\tNot Epic link event, not related")
return
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Anders Lantz Thanks so much. I'm rather new to scriptrunner and groovy scripting. what import statements do i need to have for that code snippet to work? If I paste it in as is, I got this error: "unable to resolve class IssueLinkDeletedEvent" I've added in these import statements:
import com.atlassian.jira.event.issue.link.IssueLinkCreatedEvent
import com.atlassian.jira.event.issue.link.IssueLinkDeletedEvent
But now I'm getting "No such property: issueLink for class: com.atlassian.jira.event.issue.IssueEvent." How do I resolve that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eric Lakey !
Your imports looks correct to me, my guess is that the event you are looking at simply isn't an issue link event, thus doesn't have the issueLink property. You can configure your SR listener to only trigger on IssueLinkCreatedEvent, IssueLinkDeletedEvent
I check if it's an issue link event in the first if-statement, you could do the same.
To get more information about what properties the event has you can do:
log.trace("Event:" + event.getClass())
event.properties.each { log.trace("\t" + it) }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just realised this question was tagged with jira cloud but my code is for Jira Server, so it won't likely work on cloud without modification.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didn't realize this was a jira cloud conversation either. I'm on server, so your script should work for me. I'll keep plugging away trying to figure this out. Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eric Lakey and @Anders Lantz ,
I have facing the same issue and getting the same error "No such property: issueLink for class: com.atlassian.jira.event.issue.IssueEvent." @Eri Are , Could you please tell me how did you manage to resolve the same.
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.