We're using the "all comments custom field type" plugin to migrate comments from Jira 4 to Jira 6.
There are some problems with the plugin, but the last update was in August 2012.
I've emailed the developer, but if they're not responsive then how can I get the source code of the plugin out of jira to modify it to fix the bugs myself?
Community moderators have prevented the ability to post new answers.
"You can't" is the short answer. If the developer won't provide you with the code, then you're stuck, because the distributed plugin files do not contain the source for it.
However...
If you unzip the .jar file (they're stored in a .zip like format), you'll find most of what you need to recreate the plugin - .vm and .xml files are doing a lot of the work, and they're not compiled objects, so what you see in them IS their code. You'll be missing code for the .class files, but it's actually not too hard to work backwards from the .vm files to work out what the code should do (and there are java de-compilers if you are desperate)
Hi Will,
Nic has already explained everything you can do, but I still have 2 questions for you:
Why do you need this plugin for you migration?
Will this not introduce more problems and work then simply doing a basic migration?
Just wondering.
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mmm, good point, I should have asked "why", as there are much better ways of migrating than some form of export/import-via-fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We've settled on a .csv import as previously discussed.
The few things that were missing from that were:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh, that makes sense, I remember that now :-)
I rarely post code, as I find it stops people learning to do it for themselves (so they keep coming back for more spoon-feeding), but this might help with the java. It's the most important bit of a "derived custom field" class - the bit that actually fetches the data from the database for display.
This snippet fetchs the last comment on the issue and spits it out along with the writer and date stamp. I'm sure you can see how to adapt it - iterate over the "comments" List and do more appropriate formatting.
public Object getValueFromIssue(CustomField field, Issue issue)
{
User remoteUser = authenticationContext.getUser();
List<Comment> comments = commentManager.getComments(issue);
if (comments.isEmpty()) {
return "";
}
Comment lastComment = comments.get(comments.size() - 1);
return lastComment.getAuthorFullName() + " at " + lastComment.getCreated();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.