[closed] Migrate Jira Comments/Attachments to RTC
Hi All,
CSV Exported from Jira - does not contain comments field. So, we need to use an alternate approach to get it.
Our Jira version is 3.13 - I checked on using Bugzilla as an intermediate , but looks tedious with 1 bug-file per jira-item.
Also, xml exported from Jira has comments in it. I am looking to convert this xml to a csv format with accurate data.
Please advise on the easiest approach to automate this.
Thanks.
|
The question has been closed for the following reason: "The question is answered, right answer was accepted" by valli Dec 30 '14, 4:57 a.m.
Accepted answer
the bugzilla import isn't that bad.. the jira export makes them, and then the importer reads them..
same approach as with csv. VK L selected this answer as the correct answer
Comments
VK L
commented Nov 25 '14, 10:42 p.m.
Hi Sam,
If I export Jira data in XML format, its a single XML file.There looks to be an additional conversion required for bugzilla-xml formation. And finally, the bugzilla XML to be used for RTC import.
Please advise on the Jira to bugzilla part.
Thanks.
|
5 other answers
Hi Sam,
If I export Jira data in XML format, its a single XML file.There looks to be an additional conversion required for bugzilla-xml formation. And finally, the bugzilla XML to be used for RTC import.
Please advise on the Jira to bugzilla part.
Thanks.
Comments see
VK L
commented Nov 26 '14, 1:09 p.m.
Thanks Sam. I saw this ruby script - just that I have to configure bugzilla,ruby just for this migration.
I will give it a try.
Thanks.
you do not need bugzilla, just ruby..
VK L
commented Nov 26 '14, 1:30 p.m.
Currently, we exported CSV from Jira - to import normal attributes.
Exported XML from Jira - for comments/attachments and imported into excel.
I hope the retrieved comments can be imported via CSV along with other attributes
For attachments, plain-java code to upload att. to work items.
If the ruby solution can do all of these in 1 shot, I would like to give it a try and see. Our Jira tickets have multiple comments/attachments , version is 3.13, and I haven't done attribute comparison between XML and CSV exports
sam detweiler
commented Nov 26 '14, 2:46 p.m.
CSV import of comments is really a pain.. they wrap across line ends, and will completely mess up the csv if you attempt to edit it. the xml format was much better
|
Hi Sam,
I was trying to use curl to download each jira-issue into an xml using below curl command:
xml = %x[curl -u username:password http://jira.wiley.com:9090/sr/jira.issueviews:searchrequest-xml/BUG-#{i}/BUG-#{i}.xml]
I took this URL from Jira->Find issues by creating a search filter for all the required items (Around 89). Not sure how this can be accessed using BUG-#i, as i is a sequence from 1 to 1000 in below script [*from the ruby solution-link]:
# Extract JIRA issues. (Figure out how many issues to include.)
(1..1000).each do |i|
# Use curl with credentials to extract each JIRA issue's XML.
xml = %x[curl -u username:password http://jira.wiley.com:9090/sr/jira.issueviews:searchrequest-xml/BUG-#{i}/BUG-#{i}.xml]
# Save the XML to a file.
f=File.new("BUG-#{i}.xml","w")
f.write(xml)
f.close
end
Please advise on how this Jira individual issue-link is formed
|
URL that i get on xml view of the filtered Jira issues is:
http://jira.wiley.com:9090/sr/jira.issueviews:searchrequest-xml/11234/SearchRequest-11234.xml?tempMax=1000
Please advise on how to refer the individual items in this view into an xml
Comments
sam detweiler
commented Dec 01 '14, 5:26 p.m.
the sample ruby script gets ALL tickets from 1 to 1000.. skipping none.
|
Thanks Sam. It worked with issues.XML URL using key-ids.
While downloading attachments, have you tried .jpg,.xls and so on? Only text files looks to work for me. Other files are not in a correct format type.
Please advise.
Thanks.
Comments see here http://peggylin.com/2013/11/18/exporting-ticket-comments-attachments-from-jira/
VK L
commented Dec 02 '14, 3:01 p.m.
Thanks Sam. The ruby code to get each of the attachments is working - just that the downloaded file content for excel and images - either doesnt open or format is incorrect. Maybe, I have to use different options with curl. %x to take contents and write in a file looks to cause data issue
sam detweiler
commented Dec 02 '14, 3:17 p.m.
I think you need to use an accept-header to set the datatype to binary (not text, not json...) you will probably have to set this differently for each attachmrnt request. (jpg, vs pdf, vs excel, vs text,) ... from the name of the attachment in the xml extract
|
Hi Sam,
Used open-uri in binary mode and all file-types look to work.
I used bugzilla importer with limited fields mainly comments & attachments. Attachments works, but comments has html,ascii encoding issues and doesnt completely reflect the actual comment-text in JIRA.
For comments, did you perform html,ascii encoding and validations in the ruby script? Please advise on how best it can be rendered in RTC.
If comments contains tag-based text like <title>testing<testing>, RTC is not able to import it. The comment is rendered empty.
Thanks.
Comments
sam detweiler
commented Dec 03 '14, 1:22 p.m.
the RTC comment text field does not support all the same function that the Jira comment does.. so you will have to make some adjustments.
VK L
commented Dec 05 '14, 10:17 a.m.
Thanks Sam. If possible, Please share the code-snippet for "Comments extraction from XML" and the "HTML Encoding/decoding & other processing-part [to convert comment into RTC-Supported format".
*Bugzilla importer fails to update certain comments which are not suitable for RTC-Format.
Thanks.
VK L
commented Dec 05 '14, 10:17 a.m.
Thanks Sam. If possible, Please share the code-snippet for "Comments extraction from XML" and the "HTML Encoding/decoding & other processing-part [to convert comment into RTC-Supported format".
*Bugzilla importer fails to update certain comments which are not suitable for RTC-Format.
Thanks.
I am unable to share that code, sorry
|