[Automation] problem with copying comments into a cloned issue

andrea_rodifalanga March 26, 2024

Hi all, I'm trying to copy into a clone issue the comments of the original issue, as detailed here https://confluence.atlassian.com/jirakb/how-to-copy-comments-from-the-original-issue-to-the-cloned-issue-1236601599.html

Here's the automation I createdrule.PNG

 

However the rule fails to detect the linked issue and thus updates nothing.error.PNG

Is anybody able to assist?
Many thanks in advance.

2 answers

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.
April 3, 2024

Hi @andrea_rodifalanga 

The easiest way to do this is to select the option to include the attachments when the issue is cloned manually.

 

With automation rules, the features to select the source issue for attachment copy are quite limited, requiring the source to be: the trigger issue, current issue, or some linked relationship.  Because your trigger issue is the clone, rules cannot copy in that direction (currently).  I recall there are several open suggestions to improve that behavior.

There is no public REST API function to do this either, and so marketplace addons apparently do this with custom code.

 

A possible work-around for rules is using two rules:

  • Rule 1: triggered on issue created, detect it is a clone, branch to the source issue, add a comment (or other field change) noting something like "Trigger rule 2 to copy attachments to clone"
  • Rule 2: triggered on comment added, use a condition to confirm the comment text, branch to the clone, and then copy attachments from the trigger issue.  This rule will need to enable the "Allow Rule Trigger" option so the actions of the first rule can trigger the second one.

 

Kind regards,
Bill

0 votes
Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2024

Hi @andrea_rodifalanga 

what do you mean by "the rule fails to detect the linked issue" 
The error message states, that the issue does not match the condition. Is the clone link present in the issue?

If yes it could possibly be a timing issue. Could you try to ad a refetch issue data action before the condition is evaluated. This should give some extra time in case of unfinished linking.

Everything else looks good to me.

andrea_rodifalanga March 27, 2024

Hi @Kai Becker thanks for your time and input.

After adding the refetch issue data, the error is still there

error.PNG

How would I check if the clone link is present in the issue?

Many thanks in advance.

Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 2, 2024

Hi @andrea_rodifalanga 

sad to hear. You should be able to check the json data from the api and look for the links. The api url will be https://<your site name>.atlassian.net/rest/api/3/issue/<issue-key>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events