Closing a cloned ticket automatically

Pablo Aschieri July 3, 2019

Hi! Let´s suppose that I have two different projects: A and B. Some of the A´s tickets are cloned to the B project, where all the work is registered. 

Once I close the B ticket, is there a way in which the A ticket is automatically closed? 

Thanks! 

2 answers

0 votes
Krishnanand Nayak
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.
July 3, 2019

if there is a link between the two tickets, you can add a post function to transition the linked issue.

Pablo Aschieri July 3, 2019

I´m sorry, but what do you mean by a link in this case? Also, I understand that post function doesn´t allow to close a ticket.

Krishnanand Nayak
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.
July 3, 2019

Here is an example of the link:

clone.pngif this exist then you can use a scripted post function to transition linked issue. here is an example of the scipt: 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.link.IssueLinkTypeManager

def userManager = ComponentAccessor.userManager
def anuser = userManager.getUserByKey("anuser")

def issueManager = ComponentAccessor.issueManager
MutableIssue issue = issueManager.getIssueByCurrentKey("JRA-1")

//We are going to need the issueLinkManager and the issueTypeLinkManager
IssueLinkTypeManager issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager

//We need two links, one for our outwardLinks, and the other one for our inward link.
MutableIssue outwardLinkTarget = issueManager.getIssueByCurrentKey("JRA-3")
MutableIssue inwardLinkTarget = issueManager.getIssueByCurrentKey("JRA-4")

def linkTypes = issueLinkTypeManager.issueLinkTypes
def blocksLinkId = linkTypes.find { it.name == "Blocks" }?.id

//This is how you create an outwardlink, by setting the second parameter to your other issue
issueLinkManager.createIssueLink(issue.id, outwardLinkTarget.id, blocksLinkId, 1L, anuser)
//This is how you create an inwardlink, by setting the second parameter to your original issue
issueLinkManager.createIssueLink(inwardLinkTarget.id, issue.id, blocksLinkId, 1L, anuser)

 

More examples here: https://library.adaptavist.com/entity/add-or-update-the-issue-link-for-an-issue-in-jira

Like Pablo Aschieri likes this
0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2019

Not out of the box. You may be able to write a script or find a plugin. You would also need to provide for the possibility not to close it 

Alejandro Álvarez December 3, 2020

Hi @Joe Pitt !

Has there been any improvement in JIRA Automation regarding this topic? My need is exactly the same described in this open thread. I have two tickets with a "Cloned" link. Once I transition one ticket, I would like to transition the cloned one.

Is there any plugin that you know that can do it?

 

Thanks in advance!

Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2020

Not that I'm aware of. 

Paulo Almeida November 2, 2021

looking for the same, strange, seems sucha normal user case for automation, closing tickets in chain

Jessica Dosio January 12, 2022

@Pablo Aschieri @Joe Pitt This also is strange to me. Looking for the same functionality! 

Suggest an answer

Log in or Sign up to answer