Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Can I use automation to change linked issues link type?

Edited

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

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.

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

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 :) 

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

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?

 

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
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

98 views 1 1
Read article

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