Forums

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

Automation to copy all comments when issue split

Ryan Bullock April 15, 2024

On Jira Data Center v9.4.10

Trying to create an automation that copies ALL comments over when a new issue is split from the original. We have a "DevEscalate" transition that auto-creates a new issue with a "split" relationship and we would like the comments to carryover. 

Thanks in advance for any assistance!

1 answer

0 votes
Kalyan Sattaluri
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 15, 2024

Hello @Ryan Bullock 

Unfortunately there is no solution here. Best you can do is to get all comments from original issue and update new issue as 1 comment. 

Ryan Bullock April 15, 2024

@Kalyan Sattaluri Thanks, how would I do that? I did try from a previous post, but could not get it working.

Kalyan Sattaluri
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 15, 2024

Hello @Ryan Bullock 

General syntax is:

{{#issue.comments}}{{index}}. {{body}}{{^last}},{{/}}{{/}}

as shown here: LINK 

Now depending on how you want to split the issue and set up this rule, you may have to do lookupIssue and get original comment from below, so depends on how you are handling it what triggers this rule..

{{#lookupIssues.comments}}{{index}}. {{body}}{{^last}},{{/}}{{/}}

Ryan Bullock April 15, 2024

I tried this, but it didn't copy the comments from the original to the new split Jira

2024-04-15_13-12-59.jpg

Kalyan Sattaluri
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 15, 2024

Hello @Ryan Bullock 

Your JQL for this should be  ==> issue in linkedIssues({{key}}, "split from")

But going back and checking, in Data center edition, even though we have lookupIssues, only a few fields are accessible, and comments is not one of them.

So instead of being able to access comments directly from lookupIssues, we have to make a web request call to this end point get the comments.

So have to make a call to below end point,

https://yourdomain,net/rest/api/2/issue/{{lookupIssues.key}}/comment

 

Suggest an answer

Log in or Sign up to answer