Can I use automation to change linked issues link type?

Frederik Vindum December 16, 2021

My challange is this: in a Jira cloud project a number of tasks have been cloned. This results in each issue having a summary field prefixed with "CLONE" and an issue link of type "clones" which references the issue it was cloned from. I would like to create an automation rule that could convert the issue link type from "clones" to "related to".

I have successfully created a rule that for a single issue could do that; however, I dont't want to open all issues one after the other to apply the rule. I want to be able to apply a rule that will fix all issues in the same time. As nested branches are not supported I doubt it is possible. Any thoughts? Any hints to provide another approach? I have looked at little at python for jira which seems to support the looping mechanism needed but I would rather stay entirely inside Jira.

2 answers

0 votes
Marlene Kegel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 5, 2022

Hi @Frederik Vindum,

I'm Marlene from codefortynine.

If you are not able to find a suitable solution with Jira Automation, you could try our Marketplace app Deep Clone for Jira, which - I believe - covers your use case.

With Deep Clone you can

  • Bulk Clone several issues at once
  • Remove or change the prefix "CLONE-" while Bulk Cloning
  • Change the "clones" issue link type to "relates to" while Bulk Cloning

deep-clone-jira_advanced-options.png

You would simply have to

  • Filter for the issues you want to bulk clone using the advanced issue search
  • Click on the Bulk Clone button
  • Uncheck "prefix summary" and configure "Add issue link between clone and original issue" under "advanced option" in the Deep Clone Bulk Clone cofiguration.
Frederik Vindum January 10, 2022

Hi @Marlene Kegel - codefortynine 

Thank you for getting back to me and pointing me in an interesting direction. Seems your product can help me. I'll be sure to check it out; however, I have moved on with reating my own Jira Automations.

/Frederik

Marlene Kegel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 12, 2022

Thank you for your feedback, @Frederik Vindum! I am happy to hear that you were able to solve your problem with help of the Atlassian Community :) 

0 votes
Bill Sheboy
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.
December 16, 2021

Hi @Frederik Vindum 

First thing, would you please share an image of your rule?  Did you somehow edit the link type, or remove/re-add the links with the type you want?

Next, to process the existing issues you could:

  • copy your current rule
  • change the trigger to scheduled (e.g. once per hour) with JQL, looking for issues which have the clones link
  • let them process, up to 100 issues at a time due to automation rule limits...
  • and let the rule schedule run until it no longer finds issues

Kind regards,
Bill

Frederik Vindum December 16, 2021

02-JqlBranch.png01-RuleForSingleIssue.PNGHi @Bill Sheboy

Tx for the quick reply. I have attached the basic rule (attachment 01) which applies to a single issue. The problem is two things: 1) the rule only applies to one issue (as oppossed to looping through all issues) and 2) in the last step "Link issue to" I must target the triggering issue (or newly created or a smart value {{lookupIssues}}).

My task is this:

For each issue in project:

  Remove "CLONES" from issue summary

  Add link of type "Reletes to" between current issue and issue it was cloned from

  Remove link of type "Clones"

 

My approach has been to use a manual trigger combined with a JQL branch (attachment 02). This should give me the For each -part. The summary adjustment is straight forward but when I attempt to add the Relates to -link, I have no handle to the issue that the current issue is cloned from: Trigger issue is not the issue that the current issue is cloned from and if I use the issue which was used to clone current task then that reference would be wrong in the next iteration of the look.

Makes any sense at all?

Bill Sheboy
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.
December 17, 2021

 

Hi @Frederik Vindum 

I believe this is still possible, and a bit risky.  First I will describe a rule to try, and then some possible issues.

  • trigger: scheduled on JQL to find the issues with "CLONE -" in the summary:
project = myProjectName AND summary ~ "CLONE /-"
  • action: edit issue fields to remove "CLONE -" from the summary with {{issue.summary.substringAfter("CLONE - ")}}
  • action: re-fetch the issue
  • related issues condition: linked issues with "is cloned by" are present
  • branch: for linked issues of the type "is cloned by"
    • action: link issue as "relates to" the trigger issue
    • action: re-fetch the isuse
    • action: delete issue link of type "clones"

Some possible risks and challenges:

  1. I have not tested this, so please confirm if the link types match your needs and are in the correct directions (e.g. "is cloned by" versus "clones"
  2. More importantly, how often do you clone the same issue to create others?  This rule would remove the link and so may fail if you have that situation.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events