We are migrating data from an old issuetracker to Jira (through the csv importer). I was able to map every field, even multiple comments and attachments for the same issue.
The one thing that we were not able to map were the status changes.
I can set the (final) status of the issue but want to keep track of all the status changes.
As far as I can see, Jira keeps track of these status changes in the form of changelog history items.
I can get the existing ones through REST by querying them like this ../rest/api/2/issue/PROJECT-73?expand=changelog
Output is something like this:
"changelog":{
}
Naturally, these statusses are bound to the workflow attached to the project.
Now, my question is:
- Can I insert these entries with the CSV importer? Just like comments and attachments?
- Or if not, can I add them with the REST API doing a POST or PUT command?
And it would be nice to have an example of this.
Thanks!
Jeroen
Community moderators have prevented the ability to post new answers.
It's not a problem as you think. Just put a column in the CSV file that would be unique for each issue, then during the wizard map it to Issue Id field, it will get copied to External System Id custom field. So then you will now which issue id was imported to what issue key. You can dump it and use to create JSON file.
Hi Pawel,
So I would then be able to map the JSON file to this "External System Id" custom field without having to mention the actual jira id in the JSON? So basically I would mention the "External System Id" and my historical status changes. Thats it?
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, you can't do that. If importer notices the same External Issue Id it will skip the issue.
You still have to map issues and write issue key in JSON file.
Or if you really want to have it your way (and use issue id) you can modify the importer so it will not skip issue with the same External Issue Id but it will update it. Should be rather simple but I think the first option is simpler.
Getting a matching pair of External Issue Id and Issue Key should be as simple as running Issue Navigator and exporting the results.
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.
Hi Pawel,
I'm currently trying to add history to an issue. But the JSON imports fails saying:
2012-12-12 16:51:15,715 ERROR - Failed to create data bean java.lang.RuntimeException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "key" (Class com.atlassian.jira.plugins.importer.sample.SampleData), not marked as ignorable at [Source: java.io.StringReader@eacecdf; line: 21, column: 2] (through reference chain: com.atlassian.jira.plugins.importer.sample.SampleData["key"])
The JSON that I try to upload looks like this:
{
}
Can you tell me whats wrong with this JSON?
Thanks
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This file is in incorrect format. Please oberve in the documentation that you need to have an object that has "projects" key first, then an array of objects that represent projects, then for each project's object you need to have "issues" key, which has a value that's an array that lists objects that will be imported as issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawel,
Thanks for your answers. I haven't had the chance to test it yet. But I'll do so this week and keep you posted.
Thanks
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, you are not able to use CSV importer to import them.
You can't import change history items using JIRA REST - you can change issue status, but you can not force the data to be in the past.
You can use JIRA Importers Plugin to achieve what you want, but you need to use JSON (beta) format, and the good news is that you can just update issues (so you can keep the work you did with CSV).
Here's a documentation and there's an example of an issue with some historical status changes - https://confluence.atlassian.com/pages/viewpage.action?pageId=293830712
Mind you the dates are in silly joda format, but you can use normal date format as weel, the example uses relative dates (which are kinda coll for some purposes).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawel,
That seems like a cool import tool. But it would give me a lot of work because I first have to import all issues through CSV, then need to export them into JSON format. Then update the different issues in JSON format to have all the historical status changes, and finalmly reimport them into JIRA to actually import these status changes.
I cannot automate this so easy.
That leaves me thinking, maybe we can do it in another way.
To import a comment via CSV importer, you can just enter multiple entries in the csv with the same header and then map them to the comment field in Jira.
How about creating a custom field which can do the same for my historical statusses?
Is it possible to create a custom field, for instance (Old Issuetracker Statusses), which is a collection of a date, username, oldstatus, newstatus?
Ultimate goal would be to have multiple columns in the CSV import with the header "Old Issuetracker Statusses" and map them to the custom collection field "Old Issuetracker Statusses" in Jira. The notation in the CSV would then be the same as for comments. An entry would be something like this "12/12/2012 23:00:12;jvanbortel;Open;Closed".
Can this be done fairly easy?
Thanks
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually you don't have to do the whole round-trip as you described. All you need to do is import issues using CSV, prepare a simple JSON file that would list only each issue key as created in JIRA and have for each issue history set. Then those issues that are in JIRA will be updated with the information from JSON file. Yeah, that's enough :-)
To comment your idea - sure you could create a custom field but you'd have to code all the logic into it and the parsing. I believe it's a lot of coding and the result may vary.
I advise you to try out JSON importer, just run a test with one issue and see how it goes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawel,
If such a special field needs to be coded, then you are right, the JSON would be the better option.
Though it would still present a lot of work. Why? ... wel...
Our CSV is generated through code. It does not now which JIRA Id it will get when it is imported. So I cannot automate the JSON file togheter with the CSV.
I would somehow have to list all the jira issue-id's of the imported CSV issues and then, for all these issues compile a JSON file. If I want to automate this, the export of my old issuetracking system would have to know which Jira Id is coupled to which own issue id. And it doesn't know about this. So automation of these JSON files is difficult if not impossible.
Since we are talking about 1800 issues, you can catch my drift.
So, de you have any ideas on how we can automate the generation of these JSON files? I guess, through the CSV import, you cannot force the issue to have a certain Jira Id? If that would be possible, then I could generate the JSON togheter with my CSV file since I know which Jira Id it is going to get when imported.
Thanks
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If each issue imported from CSV has set a column that is mapped to Issue ID the value will be placed in a custom field called External System ID so you will not lose the track between CSV issues and JIRA keys.
You can then dump this information from JIRA and use it to produce JSON file.
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.