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

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
Accepted answer

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.

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
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

339 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you