Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Closing a cloned ticket automatically

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
Joe Pitt Community Leader Jul 03, 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 

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 Dec 03, 2020

Not that I'm aware of. 

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

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.

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you