Forums

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

Autoclose parent ticket in PRODSEC based on status of linked tickets

Anusha Ramesh November 23, 2020

In JIRA, is there a function that allows for automating closure of linked tickets? If I have a ticket (ticket A) that is linked to another in a different queue (ticket B), either as dependent on or related to, and the other team closes ticket B, can that closure trigger ticket A to be auto-closed? Ideally with notification to owner and watchers of ticket A.

In the case of multiple links in a single ticket, ideally the logic would be that the project ticket would auto-close after all of the linked tickets are closed

2 answers

2 accepted

0 votes
Answer accepted
Anusha Ramesh November 23, 2020

Hi Daniel,

Thanks much for your response, we have scriptrunner and I will be grateful if you could help me with a script to achieve auto close particular issue type only.

Also, at times there may be more than 1 linked 'depends on'.

Please help. Appreciate your heads-up here.

Thanks

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2020

For a single issue type you just need to adapt the JQL like "project = TEST AND issuetype = Bug" for example.

It is not really a script needed there, you can use Script Runner (Script Jobs / Escalation Service).

https://scriptrunner.adaptavist.com/6.14.0/jira/ScriptJobs.html
https://scriptrunner.adaptavist.com/6.14.0/jira/escalation-service.html

Anusha Ramesh November 23, 2020

Yes Daniel, But escalation service help on auto close with the status of an issue.

Does this service help us to have an issue auto closed when linked issue(s) are closed with 'depends on' link type ? If yes could you please route me.

Thanks

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2020

Yes, this is is already basically covered by the following part of JQL I posted above:

[..snip..] issueFunction in linkedIssuesOf("status = Closed")

 and can be extended like this is you wish

[..snap..] issueFunction in linkedIssuesOf("status = Closed", "depends on")

What is absolutely true for this powerful implementation - a hour or two of testing is needed for sure.
Here is the extensive documentation for all further fine tuning
https://scriptrunner.adaptavist.com/6.14.0/jira/jql-functions.html 

Anusha Ramesh November 24, 2020

Hi DaniI, 

I created the job schedule as suggested but no luck.

JQL : project = "Product Security" AND resolution = Unresolved AND issueFunction in linkedIssuesOf("status=closed","depends on")

Please help

Anusha Ramesh November 24, 2020

Autoclose.jpeg

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2020

I tested it - and it works. But with a correction:
in the last part the direction of the destination link is necessary - so not "depends on" for example but instead "is depending on" (please check how it is correctly named in your instance

[...] issueFunction in linkedIssuesOf("status=closed","is depending on")
Anusha Ramesh November 25, 2020

Hi Daniel,

You are peach :D :)

It works but the issue is closed if any one child issue is closed. 

Request will be completed when all linked issues are closed.. need the source issue to be closed. Will any alteration help here ?

Thanks

Screenshot 2020-11-25 at 5.13.55 PM.png

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2020

You're right - it works actually only with one issue.
There is a similar question in Community (from 2019), I have not tested it and cannot guarantee if it works.

https://community.atlassian.com/t5/Jira-questions/Transition-an-issue-when-all-linked-issue-are-closed/qaq-p/1157809

Here is some alternative approach - but this would need a different App then the mentioned:

https://community.atlassian.com/t5/Jira-Software-questions/How-to-have-linked-issue-closed-after-all-other-linked-issues/qaq-p/1242465

Apart from that I am out of idea, unfortunately.

0 votes
Answer accepted
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2020

Hi Anusha,

welcome to Atlassian Community!

You could do something like this for example with Script Runner (Script Jobs / Escalation Service).

I used to implement this in the past for a use case that reads:

- an issue in project ACCOUNT
- that is currently in status "on hold"
- should be closed (you can define this in the Script Job section as well)
- as soon the/all linked issue(s) is/are closed

project = ACCOUNT AND status = "On Hold" AND issueFunction in linkedIssuesOf("status = Closed")

Please note this depends on if you already have Apps that are capable of fulfilling this requirement. In the example Script Runner was used but there are probably other Apps from Marketplace which are also suitable.
Please note: the App in question needs extra payment.

There is also Automation from Atlassian - but this is nowaways extremely popular with Cloud.
You mentioned server why I wanted to share the approach using Script Runner.

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer