Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to Import worklogs into Jira using CSV Edited

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

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. 

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? 

This is very useful, thank you!

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

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. 

Hi Marton,

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

@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 Thomas Rohrer likes this

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you