Forums

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

Copy comments from sub task to parent issue

Pranita Warik September 16, 2020

When the sub task is resolved, the user's comments are stored in the Comment section of sub task. I want to copy these comments to the parent issue's comment section.

Is there any available plugin to achieve this?

Or a script has to be coded? If yes then, where exactly the script has to be called?

2 answers

1 accepted

1 vote
Answer accepted
Florian
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.
September 16, 2020

Hi Pranita

This is straight forward with Automation by Jira. You can create an automation rule that is triggered either on comment of the subtask or on transition of the subtask. The first way will copy each comment as soon as possible and it even as a beginner with no experience you will get this running in the first try. The second script where you have to wait until the subtask is done before a bulk copy is executed is bit more tricky. But I think it is feasible with a reasonable amount of work. 

 

here the first rule

- on comment of an issue

- if issuetype is subtask

- Iterate over linked issues “parent”

- comment on issue {{triggerissue.comments.last.body}}

here the second approach (I am not sure if it will run that way)

- on transition to done

- if issuetype is subtask

- iterate over linked issues “parent”

- comment issue {{triggerissue.comments}}

The very last step might not work. I dot not try. 

good luck

Pranita Warik September 17, 2020

Hi @Florian 

I do not have the Automation for JIRA Plugin. Can anything be done with JSU Plugin?

Maria Kazakou {Appfire} September 17, 2020

Hi  @Pranita Warik 

With JSU it is possible to copy the transition comment or the last comment, so the comment that is entered during the Resolve transition can be copied to the parent.

If every comment needs to be copied this can only be achieved by using a transition to comment, instead of commenting directly on the issue.

Best,
Maria

Like Pranita Warik likes this
Pranita Warik September 17, 2020

Hi @Maria Kazakou {Appfire} 

I wanted to copy the transition comment only. It works:

CaptureComment.JPG

Maria Kazakou {Appfire} September 17, 2020

Great @Pranita Warik! Glad to know I could help!

Should you need further support, please reach out to our Service Desk.

Best,
Maria

Ravindra
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 20, 2022

Hi @Florian ,

I am able to get the trigger to work. But parent story shows that the comment was made by the Actor which defaults to the user who created the trigger. I am not able to set the Actor to 'assignee' or user who added the comment when I create the trigger. 

Do you have a suggestion for this?

Thanks.

0 votes
Adam Rypel _MoroSystems_
Community Champion
September 16, 2020

Hello @Pranita Warik ,

you can do that via plugin and also via script. I think the Automation for Jira would be the most suitable plugin to use for this.

Please check out this thread to find out more, you can also see the script examples in there:

https://community.atlassian.com/t5/Answers-Developer-Questions/Subtask-to-Parent-Commenting/qaq-p/577044

In case of any questions, let me know!
Adam

Pranita Warik September 16, 2020

Hi @Adam Rypel _MoroSystems_ 

I had tried the code (Answer Accepted) in the link shared by you. But it comments were not copied. I have called the script on the post function when the sub task is getting resolved.

Adam Rypel _MoroSystems_
Community Champion
September 18, 2020

Hello @Pranita Warik ,

I am late - sorry, but glad you have found the answer in the meantime. In case you need more help, let us know.

Adam

Alex Romano
Contributor
September 24, 2020

@Florian Thank you for that information. Out of curiosity, what automation steps are implied with "iterate over?"

Florian
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.
September 26, 2020

Hi @Pranita Warik 

with „iterate“ I mean a loop that allows you to handle one task after another. Some programming languages have something like „foreach“ as an iteratir statement. In Automation For Jira this can be achieved with the purple action. I think it named „branch“. 

Automation for Jira has four categories of „LEGO bricks“ that build you script. 

- Triggers (green) initiate a script on an event or timer based rule.

- Conditions (orange) allow you to decide what you want to do on under certain circumstances. 

- Actions (blue) is the actual automation step. Like modify a value. 

- Branch (purple) triggers sub processes for other issues that relate to your rule in some way (subtask, linked issues, whatever). 

I hope this helps. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5.1
TAGS
AUG Leaders

Atlassian Community Events