|
There is actually an undocumented feature in the CSV importer that people could use if there are very keen on importing the comment's author & date.
Comments are parsed from the CSV file using an implementation of the com.atlassian.jira.imports.csv.mappers.ExternalCommentMapper object. By default it is a SimpleCommentMapper that uses the text of the comment as the body. It is possible to use an alternative mapper that parses the comment text for user & date information. As an example, you can add this property into your CSV file. settings.advanced.mapper.comment = com.atlassian.jira.imports.csv.mappers.PvcsComment This uses the PvcsComment parser instead and parses date & username from comments created by a PVCS system that looks like: "Tester Notes: MarkChai: 6/19/01 9:41:46 AM: Sufficiently tested attempting demos. Issue retired." A comment will be created with username "markchai" with the correct date. You can use the source to com.atlassian.jira.imports.csv.mappers.PvcsComment as a starting point for an importer and go from there. Where can I get the source code for PvcsComment? I'd like to write my own such comment mapper, but the Javadocs are practically empty.
I don't have any idea what BuildFromMultiMap is supposed to do or what its inputs and outputs are. I was hoping to find some code so I could see what to do, but I can't find any. I guess when you say "undocumented feature" you mean <b>really</b> undocumented. Help? I've attached the PvcsComment.java
Collection commentBodies = (Collection) bean.get(COMMENT); and you can then parse it however you want to return a Collection of ExternalComment objects. Thank you. I'd like more information in my comment mapper and I hope it's available. My name/date info isn't always located in the text itself. We may need to access data from other fields in the record. What I'd like is if that bean had access to everything (perhaps through the different key on the map?)
We have several fields and we are all mapping them to "comment", so I want to use this mapper to adjust the text and the order based on which field it came from, and it doesn't look like that information is available via this hook. Can you help? Hi Daniel,
I think your questions are getting a little off-topic to this current Jira sub task. It may be better to ask this kind of question in the JIRA developer forums However if you are in excel, wouldn't it be possible to simply append text together and/or use a few custom fields for the values in question? Regards, Is the settings.advanced.mapper.comment property still supported in JIRA 3.7.1?
I'm trying to use it, but it does not work. Looking at com.atlassian.jira.web.action.util.CvsImporter, the property doesn't get read, as does the other customer properties. – Damien Hi Damien,
Yes you are correct, the settings.advanced.mapper.comment is not parsed in the CSVImporter (ie. ignored) in 3.7
Do you know what the other customer properties that are being ignored as well? or is this an assumption from inspecting the CSVImporter source? Thanks for reporting,
The other ones are fine. I meant to write that this property is not being read, but the others are. Thanks for the response. – Damien This has been fixed for 3.7.2.
The comment mapper should work as it did before 3.7 Is this still working in 3.10? I've added "settings.advanced.mapper.comment = com.atlassian.jira.imports.csv.mappers.PvcsComment" to the import config file, but nothing's changing.
Richard,
The best thing to do is to create a support request in our support system: Our support team should be able to help. Cheers, |
||||||||||||||||||||||||||||||||||||||||||||||||||||
1. Import using CSV data and keep track of the original bug id to Jira bug id mapping. The XML version of a report can be parsed to give the id element of a key (10102), it's name (TST-2) and the original bug id from a custom field (1234).
2. Describe what the SQL INSERT statements should look like for the jiraaction table and then convert the comments along with their authors and creation dates into SQL statements
3. Insert them into jiraaction.
I know that writing SQL is tedious, the comment ids have to be unique and generated by the database, and that it all depends upon a schema which may change from version to version.
The important question is: <b>is the jiraaction table the only one that is affected by adding a comment?</b>