How to export comments from subtasks?


I need to get rid of Sub-tasks, and I would like to place comments from existing sub-tasks to the parent issues. I noticed that comments are not exported to Excel, but can be exported to World which is not very usefull.

Could you please advise where I can start from in order to export comments?

Thanky you.

Best regards, Georgiy

2 answers

1 accepted

You can use JIRA Command Line Interface to export all comments for a project (xxx) to CSV:

jira -a runFromIssueList --project xxx --common "-a getCommentList --issue @issue@ --outputFormat 2 --append --file xxx-comments.txt"

or subset the runFromIssueList with JQL search term to only do only subtasks.

From there, you can process the CSV with your favorite scripting language (like groovy :)) using addComment to add the comments back in. Unfortunately, because of limitations of JIRA, the comments get added with the current date and script user id.

Thank you ! I took this approach and it worls pretty well!

Cheers, Georgiy


could you please advise what format to use in order to get Sub-Tasks field from parent issues?

I tried following comand with output formats 2,200,998,999, but could not get Sub-Tasks field

jira --action getIssueList --append --file output.txt --search "issueKey=issue-1 or issueKey=issue-2" --outputFormat 200

Thank you.Georgiy

I think you want something like: --search "parent = issue-1 or parent = issue-2"

Thank you Bob for advise! Actually my intention is to have output file which contains following fields

Key;Issue Type; Fix Version/s; Custom_field1; Custom_field2 ;Original Estimate;Remaining Estimate;Time Spent;Sub-Tasks

because I will use such file to find what comments should be written from sub-tasks to parent issues.

Do you know whether it's possible to vary output format for searched queries?

No. There are a few different output formats that give more fields, but, the order and field selection is fixed.

ok. Could you please advise where I can read more about output formats? I could not format which would contains "Issue Id" and "Sub-Task" for this issue in one output file.

getIssueList lists the output formats - use 999 to see all available fields.

999 format does not contain information about Sub-tasks.

So, is there no JIRA CLI command to list issues with their sub-tasks?

getIssueList with something like: --search "parent = issue-1 or parent = issue-2"

0 vote

There is no option to export comments to Excel now.

The best solution here is to do it in the database. You need to replace the subtask ids in jiraaction table with that of its parent ids.

Try it in the Test environment only first;)

If you are not comfortable touching DB, go for a simple servlet which copies those comments over.

Thanky you for your advise, but i used the solution mentioned below.

Regards, Georgiy

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

130 views 3 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot