Forums

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

How to export comments from subtasks?

Georgiy Senenkov
Contributor
July 19, 2012

Hello,

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

0 votes
Answer accepted
Bob Swift
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.
July 19, 2012

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.

Georgiy Senenkov
Contributor
July 23, 2012

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

Cheers, Georgiy

Georgiy Senenkov
Contributor
July 24, 2012

Hello,

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

Bob Swift
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.
July 24, 2012

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

Georgiy Senenkov
Contributor
July 29, 2012

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?

Bob Swift
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.
July 29, 2012

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

Georgiy Senenkov
Contributor
July 30, 2012

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.

Bob Swift
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.
July 30, 2012

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

Georgiy Senenkov
Contributor
July 31, 2012

999 format does not contain information about Sub-tasks.

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

Bob Swift
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.
July 31, 2012

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

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 19, 2012

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.

Georgiy Senenkov
Contributor
July 23, 2012

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

Regards, Georgiy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events