Is it possible to close the parent issue when all linked issues are closed?

MM _PREM_ February 29, 2016

Is it somehow possible to close the parent issue when all linked issues are closed?

We have Scriptrunner in place. Is there any ready to use script (post transition) or do we need to develop that on our own?

 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
MM _PREM_ March 8, 2016

Thank you. We will try it out!

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2016

Hi M.Maerki,

I have attached below a sample script along with a screenshot of how to configure it. The Fast Track Transition listener will Transition a parent issue to Done when one of the linked issue is transitioned to done.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink

// Get the Issue Link Manager
def linkMgr = ComponentAccessor.getIssueLinkManager()

// If one of the linked issues is set to Done then close the parent issue.
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)) {
    if (! link.sourceObject.getStatusObject() != "Done") {
        return   true
    }
    return false
}

image2016-3-7 14:48:59.png

You will be able to use place this code in a fast track transition listener as described here and modify it to check that all Linked issues are done if that it is what you require.

I hope this helps

Thanks

Kristian

TAGS
AUG Leaders

Atlassian Community Events