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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 do I create multiple worklogs at once using JIRA Tempo API?

Using the API, I can successfuly create a single Tempo worklog entry with...

{
"attributes": {
"_Activity_": {
"name": "Activity",
"workAttributeId": 1,
"value": "Research"
}
},
"billableSeconds": null,
"comment": null,
"remainingEstimate": null,
"originTaskId": "PROJECTX-2",
"timeSpentSeconds": 10944,
"worker": "janedoe",
"started": "2021-03-22",
"endDate": "2021-03-26T00:00:00.000"
}

However if I try to create a bunch at once using an array like this...

[
{
"attributes": {
"_Activity_": {
"name": "Activity",
"workAttributeId": 1,
"value": "Research"
}
},
"billableSeconds": null,
"comment": null,
"remainingEstimate": null,
"originTaskId": "PROJECTX-2",
"timeSpentSeconds": 10944,
"worker": "janedoe",
"started": "2021-03-22",
"endDate": "2021-03-26T00:00:00.000"
},
{
"attributes": {
"_Activity_": {
"name": "Activity",
"workAttributeId": 1,
"value": "Development"
}
},
"billableSeconds": null,
"comment": null,
"remainingEstimate": null,
"originTaskId": "PROJECTX-1",
"timeSpentSeconds": 13680,
"worker": "janedoe",
"started": "2021-03-22",
"endDate": "2021-03-26T00:00:00.000"
},
{
"attributes": {
"_Activity_": {
"name": "Activity",
"workAttributeId": 1,
"value": "Admin Work"
}
},
"billableSeconds": null,
"comment": null,
"remainingEstimate": null,
"originTaskId": "PROJECTX-3",
"timeSpentSeconds": 2736,
"worker": "janedoe",
"started": "2021-03-22",
"endDate": "2021-03-26T00:00:00.000"
}
]

...I get the following error: 

Can not deserialize instance of com.tempoplugin.worklog.v4.rest.TimesheetWorklogBean out of START_ARRAY token at [Source: org.apache.catalina.connector.CoyoteInputStream@37059e8a; line: 1, column: 1]

My JSON is valid according to both my own JSON parsing tools and double-check with online tools like https://jsonlint.com/.  NB: this code block strips indenting spaces.
And I know this used to work, but perhaps I am thinking about an older version of JIRA Server.

Does anyone have any clues as to what might be causing this error?

1 answer

1 accepted

1 vote
Answer accepted

HI @chrisjacks ,

our REST API do not support batch uploading. You will need to call the POST endpoint for each single worklog that you want to create.

Feel free to submit an enhance request for that in our idea portal.

BR

OK thanks, good to have that confirmed. :)

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