How to import workllogs with JIRa Importers Plugin? Preferrably in JSON format.

Andriy Zhdanov
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.
December 2, 2012

Hi,

JIRA Importers Plugin documentation mentions that it is possible to import worklogs: https://confluence.atlassian.com/display/JIRA/Importing+Data+from+CSV#ImportingDatafromCSV-Importingworklogentries

However provided example does not make sense, it does not have relation to issue.

I've also noticed that JSON import is not advertised anymore but used in greenhopper-sample-data: https://bitbucket.org/nmuldoon/greenhopper-sample-data

Does this approach [sampleDataImporter.createSampleData(json, ...)] allow to import worklogs?

Similarly to issue history, e.g.:

"history" : [],
               "worklog" : [
                  {
                     "author" : "${currentUser}",
                     "startdate" : "2012-12-03T00:00",
                     "timeworked" : 3600
                  }
               ]

What would be actually the right format if it's possible?

This is derived from https://answers.atlassian.com/questions/110377/anyone-willing-to-offer-a-copy-of-their-db

Thank you!

2 answers

1 accepted

0 votes
Answer accepted
Victor Dulepov January 10, 2013

CSV import of worklog entries works for me with the latest JIM plugin. Two major issues however:

  • you have to specify (and thus overwrite) the issue summary each time, otherwise the import wizard won't let you through.
  • you have to put multiple woklog entries for the same existing issue on one line, otherwise the subsequent line will override what was imported to the same issue in previous lines (the comments in the Work Log tab will remain, but not the Time Spent values).

Consider the following sample .CSV:

Summary,issue key,estimated time,Worklog,Worklog
Original Summary,PRJCODE-1829,360000,Entry 1-1;2013-01-01 12:30:10;user1;4800,Entry 1-2;2013-01-02 12:30:10;user2;4800
Original Summary2,PRJCODE-1829,363600,Entry 2-1;2013-01-03 12:30:10;user1;3600,Entry 2-2;2012-12-12 12:30:10;user2;4800

It will leave your issue PRJCODE-1829 with just the values from the second line (so a total of 2h20min in your Time Spent frame and 101h of Original Estimate for that issue), but you'll still have four comments on the Work Log tab.

0 votes
Andriy Zhdanov
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.
December 2, 2012

Note, example above fails:

javax.script.ScriptException: java.lang.RuntimeException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "worklog" (Class com.atlassian.jira.plugins.importer.external.beans.ExternalIssue), not marked as ignorable at [Source: java.io.StringReader@493281c9; line: 35, column: 20] (through reference chain: com.atlassian.jira.plugins.importer.external.beans.ExternalProject["issues"]->com.atlassian.jira.plugins.importer.external.beans.ExternalIssue["worklog"])

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events