How to Import worklogs into Jira using CSV

M Vijay Kumar April 25, 2017

Hi,

One of the team member has accidentally deleted around 3000 + worklog records from the production system. We have the data backup and trying to import them back to Jira and we are facing the below issue while doing this.

1. We use Tempo and trying to import the work logs
2. We have understood that tempo doesn't provide bulk import of work logs through excel/csv
3. We are using External system import, and are unable to map different users for the same issue in the mapping section. For example, an issue contains 10 users and their corresponding logged work but we are finding difficulty to map to different users.

The fields which are facing difficulty are 'Log-work ' fields which we are unable to during mapping [kindly see the atatched for reference]

 

Worklog_1.PNG

Any information or help provided will be really appreciated.

 

Thanks,

Vijay

4 answers

4 votes
marton_lipcsik November 9, 2017

Here is my sample for worklog CSV import. The first line is the CSV header, the next lines are the data for worklog entries.

What is important for worklog import is that there are some required columns for the CSV importer, you have to place in your CSV. That is why the "pj_name", "pj_type", "pj_key", and "Summary" columns are in the CSV.

What info do you need for a worklog entry?

1.) which ISSUE is the task the user worked on->issue_key column

2/a worklog entry description
2/b Day of work
2/c time the work started 
2/d user who worked 
2/e work duration (JIRA only accepts in seconds)

the 2.) a+b+c+d+e data is in the "Worklog" column

You can see, the column delimiter is (,), but inside the "Worklog" column the worklog entry data delimiter is (;)

Unfortunately JIRA CSV import documention does not really describes it. 

So the sample CSV below contains the necessary columns for the CSV importer ("pj_name", "pj_type", "pj_key", and "Summary"), and contains the necessary columns for the worklog entry ("issue_key" and "Worklog")

The Summary column contains the summary field text of the ISSUE where you want to import the worklog entry.

issue_key,pj_name,pj type,pj_key,Summary,Worklog
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description1;2017.11.09 12:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description2;2017.11.09 13:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description3;2017.11.09 14:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description4;2017.11.09 12:30;mlipcsik;3600

 

CSV import steps:

1.) Select the CSV file and [Next] button

2.) Select "Defined in CSV" on the "Import to project" option

3.) Date format is dispayed the system default date format, and you have to use the same format in your CSV. My date format is "yyyy.MM.dd HH:mm", that is why I use "2017.11.09 12:30" in my CSV

[Next] button

4.) JIRA field mapping page, map the fields like this:

CSV field - JIRA field

Summary - Summary

Worklog - Worklog (in seconds)

issue_key - Issue Key

pj type - Project type

pj_key - Project key

pj_name - Project name

I did not checked any "Map field value" options, but it also works, if you check it.

[Next] button

[Begin import]

That is all.

Hope this helps you for your worklog entry import. 

Naveen May 2, 2018

Hi Marton,

I didn't find Work log in JIRA field mapping page, is that a custom field.

vrgl June 23, 2019

@Naveen you can find it via the External System Import (log in as admin > System > External System Import ) 

Some import options are available for admins only.

Like # people like this
Vedant Kulkarni
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.
November 8, 2021

@marton_lipcsik

The above steps work for us. But duplicate worklogs have been observed in CSV export and also after importing the data in Jira.

Jira server version: 7.11.2

2 votes
marton_lipcsik November 9, 2017

Hello Vijay

 

Here is my sample for worklog CSV import. The first line is the CSV header, the next lines are the data for worklog entries.

What is important for worklog import is that there are some required columns for the CSV importer, you have to place in your CSV. That is why the "pj_name", "pj_type", "pj_key", and "Summary" columns are in the CSV.

What info do you need for a worklog entry?

1.) which ISSUE is the task the user worked on->issue_key column

2/a worklog entry description
2/b Day of work
2/c time the work started 
2/d user who worked 
2/e work duration (JIRA only accepts in seconds)

the 2.) a+b+c+d+e data is in the "Worklog" column

You can see, the column delimiter is (,), but inside the "Worklog" column the worklog entry data delimiter is (;)

Unfortunately JIRA CSV import documention does not really describes it. 

So the sample CSV below contains the necessary columns for the CSV importer ("pj_name", "pj_type", "pj_key", and "Summary"), and contains the necessary columns for the worklog entry ("issue_key" and "Worklog")

The Summary column contains the summary field text of the ISSUE where you want to import the worklog entry.

issue_key,pj_name,pj type,pj_key,Summary,Worklog
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description1;2017.11.09 12:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description2;2017.11.09 13:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description3;2017.11.09 14:30;mlipcsik;3600
RRIMPF03-10,RR-IMP-F03 RFP,software,RRIMPF03,Summary of the ISSUE,worklog entry description4;2017.11.09 12:30;mlipcsik;3600

 

CSV import steps:

1.) Select the CSV file and [Next] button

2.) Select "Defined in CSV" on the "Import to project" option

3.) Date format is dispayed the system default date format, and you have to use the same format in your CSV. My date format is "yyyy.MM.dd HH:mm", that is why I use "2017.11.09 12:30" in my CSV

[Next] button

4.) JIRA field mapping page, map the fields like this:

CSV field - JIRA field

Summary - Summary

Worklog - Worklog (in seconds)

issue_key - Issue Key

pj type - Project type

pj_key - Project key

pj_name - Project name

I did not checked any "Map field value" options, but it also works, if you check it.

[Next] button

[Begin import]

That is all.

Hope this helps you for your worklog entry import. 

Robert Achmann November 3, 2018

Martin - I'm using JIRA cloud and the worklog field just reports  exception on worklog field:

 

Exception occurred parsing worklog 'Generate and upload (maps);2018-10-31 12:00;the.user;28800'. It will be skipped

 

Any ideas? 

Thomas Rohrer December 3, 2019

This is very useful, thank you!

bolein95 February 24, 2020

With such import, Jira does not automatically reduce the "Estimated Time Remaining" field. How do you go about that?

marton_lipcsik March 12, 2021

@bolein95 
I'm not sure if it works,  but it may a try to log a new log on the issue, and then it might update the time remaining field. 

1 vote
Robert Achmann June 23, 2019

JIRA Cloud:

 

I've discovered that the worklog date-time portion must include seconds - and your datetime format pattern must match what you provide to JIRA. I've only been successful with:

yyyy-MM-dd HH:mm:ss 

And don't include too many extra fields in the import CSV. Columns like 'comments' may have not UTF-8 characters, even though it was originally exported from JIRA in the first place!

For "Import to Project" - You should choose the option; "Defined in CSV" and just need:

  • Project Key (not ID)
  • Project Description
  • Project Type (software or whatever...)

to find the project.

Then you need

  • Issue Key (not ID)
  • Summary (must match what the issue key points to)
  • Assignee
  • worklog (in seconds)

 

You end up with something like:

worklog,Summary,Issue key,Issue id,Issue Type,Status,Project key,Project name,Project type,Project lead,Project description,Project url,Priority,Resolution,Assignee,Reporter,Creator,Created,Updated
Test item summary segmented Phil;2019-05-22 13:13:00;john.smith;28800,Test item summary segmented Phil,PROJ-1376,32988,Story,In Progress,PROJ,Sample Project,software,theman,,,Medium,,john.smith,william.weaton,william.weaton,2019-05-22 13:48,2019-05-22 13:13
Test item summary segmented Phil;2019-05-22 13:13:00;william.weaton;28800,Test item summary segmented Phil,PROJ-1376,32988,Story,In Progress,PROJ,Sample Project,software,theman,,,Medium,,william.weaton,william.weaton,william.weaton,2019-05-22 13:48,2019-05-22 13:13

 

Copy that into some text editor and save as CSV - then open in Excel, or what have you... You can see that it doesn't matter who the assignee is. the time will be assigned to that user.

Items in the worklog column are separated by a semi-colon (;). They are:

[summary];[date-time];[assignee];[seconds]

  • summary MUST match that of the issue key the line item points to. 
  • date-time MUST be in the format above, include seconds in the time, and provided when loading the CSV in JIRA
  • assignee MUST be the JIRA known ID of the person you want the time to be assigned to: do a JIRA query to find the correct ID to place here as it's not always obvious!
  • seconds of time is of the day above only; so one hour is 3600 seconds - multiply that by however many hours the person worked on that ticket, like 2.25 to get the number of seconds for that line item (2.5h = 8100 seconds).

 

Screen Shot 2019-06-24 at 12.08.12 PM.png

Tasya Febriany July 5, 2023

Hello,

I've tried this in my JIRA Cloud, but the results was "Anonymous". And here's my csv:

 

worklog,Summary,Issue key,Issue Type,Parent ID,Assignee,Reporter,Created,Updated
"Test item summary;2023-06-22 13:13:00;623212298c349300687c8018;3600",Test item summary,PET-2715,Task,PET-2417,623212298c349300687c8018,60f4deacd5c92900694c81fc,22/06/2023 13:48,22/06/2023 13:13

 

How can i fix it?Sample.jpg

0 votes
Rajeev Kumar June 13, 2017

Suggest an answer

Log in or Sign up to answer