Help needed for importing History information using JSON file..

satyakam panigrahi August 25, 2013

my requirement is to import History information to the existing issues in JIRA,

As mentioned by Atalisian, i tried to import using JSON file, but i am getting error..

Also i am not sure how i will include the issue key for the respective history info in JSON file,

So, here i have given my test JSON file, can anybody check & let me know, how i can include the issue key in my JSON file ..

{
"history" : [
{
"author" : "guest",
"created": "2012-08-31T15:59:02.161+0100",
"items": [
{
"fieldType" : "jira",
"field" : "status",
"from" : "1",
"fromString" : "Open",
"to" : "5",
"toString" : "Resolved"
}
]
}
],
}

Thanks,

Satya

2 answers

0 votes
Pawel Niewiadomski
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.
August 26, 2013

Your JSON file is invalid you cannot place history out of the issue context. The file has to follow the structure defined in https://confluence.atlassian.com/pages/viewpage.action?pageId=293830712#ImportingDatafromJSON%28betarelease%29-JSONfileexample

You must not take arbitrary part of the file and try to import it, it will fail as proved.

If you want to import history you still need to define project, issues and then for each issue you can list history.

Please refer to the example JSON file presented in the documentation.

Pawel Niewiadomski
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.
August 26, 2013

Also one other thing about using Answers - I see you post answers in your own name with follow up questions. The practice is that if any of the answers is not clear you should be asking follow up questions using "Comment" link that each of the answers has.

The idea is that Answers should be proposed solution for the problem, it makes it clear for other readers what are the proposals, and allows them to easily spot the right one.

Also if someone happens to answer to your problem and the solution is correct you should accepts the answer - it helps them gain karma points which then help them increase their status.

EddieW
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.
August 27, 2013

Hey @Pawel, good tip on the comments.

Likewise instead of duplicating an existing answer it is better to expand upon it. (I noticed your answer points to the same root cause as mine, and even includes a duplicate link. )

Cheers

Pawel Niewiadomski
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.
August 27, 2013

Sorry Eddie, I haven't noticed that. Didn't read it to be honest :-)

0 votes
EddieW
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.
August 25, 2013

Satya, what error are you getting?

It may not be possible to import history without importing the issue itself, but to try, make sure you wrap your payload above inside a "project" > "issues as shown on the importing json docs. https://confluence.atlassian.com/pages/viewpage.action?pageId=293830712#ImportingDatafromJSON%28betarelease%29-JSONfileexample

RAMANIGANTH_VELUR August 26, 2013

also can you please tell me what you mean by "you wrap your payload above inside a "project" ??

RAMANIGANTH_VELUR August 26, 2013

2013-08-27 16:57:01,593 ERROR - Failed to create data bean java.lang.RuntimeException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "history" (Class com.atlassian.jira.plugins.importer.sample.SampleData), not marked as ignorable at [Source: java.io.StringReader@121ecaf; line: 18, column: 2] (through reference

EddieW
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.
August 27, 2013

@ramaniganth - look at the sample on the link I included.

history must be inside an "issues" list, and cannot be the "root" object. And I think you'll also need a "project" object.

{

 "projects":[{

"key":"ISSUE",

"issues": [{

"key":"ISSUE-123",

"history":[{

...

}]

}]

}]

}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events