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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.