Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Automation - Clone Issue, clone comments, link issues

Yannick-Noah Raubuch February 8, 2024

Hi all,

I tried to find a solution over the community but I am still struggling. I hope someone can guide me or can give me any tipps. Maybe I am too blind to see the solution myself.

We are working with two JIRA boards,  Idea board and dev board. When a ticket is moved on the idea board from "in review" to "done" with status accepted, I wanted the automation to clone the issue onto the dev board, link the two issues and clone also all the comments.

JIRA.jpg

All is working except for the Link issue to and the add comment to issue. The automation creates me a Clone ticket on the new board but I do not get a link to the root issue nor are taking any comments over...

What am I missing? Is my approach somehow wrong? Thanks in advance for the help. Very much appreciated.

 

With best regards,

Yannick

2 answers

1 vote
Trudy Claspill
Community Champion
February 8, 2024

Hello @Yannick-Noah Raubuch 

The reason your rule is not linking the trigger issue to the newly created issue is because of the context.

At the point you are executing the Link Issues action, the issue context is still the trigger issue. So the action is trying to create a link to the trigger issue from the trigger issue.

To create the link between the Clone and the trigger issue you need to do this to change the context/focus to the newly created issue:

Screenshot 2024-02-08 at 12.29.06 PM.png

You will need to add the Assign action and the Comments action within that branch also.

In the Comments action you will need to change the smart value from issue to triggerIssue. "issue" references the issue that is currently in context, which would be the newly created issue when the actions are within the branch. You can use "triggerIssue" to refer back to the issue that originally triggered the rule.

I note also that you are creating the clone in a different project than the trigger issue. In order to make changes to that newly created issue within this rule your rule scope will have to include both the source project of the trigger issue and the destination project of the newly created issue.

Lastly note that when you use {{triggerIssue.comments.reverse.body}} what you will get as output is a comma separated list of the bodies of the comments. You won't get the authors or dates each comment was made. 

So if you had three separate comments:

Author1 on 1/1/2024
comment 1

Author2 on 1/2/2024
comment 2

Author3 on 1/3/2024
comment 3

 

...then what you would get in your cloned issue is one comment dated with the current date and containing:

"comment 3, comment 2, comment 1"

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.
February 8, 2024

Hi @Yannick-Noah Raubuch 

Yes, and...to Trudy's answer:

Although you could iterate over the comments in the trigger issue and add them one-by-one to the newly created issue, there is no guarantee of what order they will be in for the new issue.  As your intent is to copy "idea" issues to "delivery" ones, the order of the comments may be relevant to your teams.

The reason for this sequence behavior is rule branching on more-than-one-thing is executed in parallel, each item processing on its own, helping to improve performance, etc.  And there is no guarantee of when the branch will complete, up until the last step of the rule.

There are marketplace apps to help cloning, and they may perform the processing sequentially rather than in parallel, helping to make the clone as close to the original as possible.  If you need the comments in the original order, perhaps investigate marketplace addons, specifically asking the vendor how their tool handles such things.

Kind regards,
Bill

Like Trudy Claspill likes this
Yannick-Noah Raubuch February 12, 2024

Hi both,

 

thank you so much for the answers. I changed my automation now to this. I included a separate branch and changed the information in the comment to triggerIssue...but somehow, the automation seems to work (no errors) but I am still not getting the link between the tickets and the comments.

Is there anything else I need to give permission or so?Screenshot 2024-02-12 at 10.45.51.png

 

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.
February 12, 2024

@Yannick-Noah Raubuch would you please post an image showing the audit log details for the rule execution?  That may provide some explanation of what is happening.  Thanks!

Yannick-Noah Raubuch February 15, 2024

@Bill Sheboy thank you. I hope this is somehow useful:

Screenshot 2024-02-16 at 08.22.05.png

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.
February 16, 2024

Ah...the issues are in different projects.

I hypothesize you created this rule in a single project, and so it has a single-project scope.  Rules in one project can create (or clone) issues into other projects, but they cannot see or edit them otherwise, and linking is an edit (i.e., both issues in the linking change).  As the log shows, the branch did not find the issue as it is outside of the project.

The fix is to change the project's scope to global or multiple-projects, and potentially to add more rule conditions, as needed.  To change the scope, as you have site admin permissions:

  • navigate to the global rules list from admin functions
  • find your rule, and select it to edit
  • looking at the rule Details at the top, change the Scope to include the two projects

 

0 votes
Aaron Pavez [ServiceRocket]
Community Champion
February 8, 2024

Hi @Yannick-Noah Raubuch 

Can you share a screenshot of the Audit log?

Does it say anything if it fails or if it works?

Regards

Aaron

Yannick-Noah Raubuch February 12, 2024

Hi Aaron,

 

thank you :-) there is no error. It seems to work fine.

 

Regards,

Yannick

Suggest an answer

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

Atlassian Community Events