Hi,
I want to add a new worklog to an issue:
const issueId = 1000
AP.request(`/rest/api/3/issue/${issueId}/worklog`, {
type: 'POST',
contentType: 'application/json',
headers: { 'Accept': 'application/json' },
data: {
"timeSpentSeconds": 12000,
"visibility": {
"type": "group",
"value": "jira-developers"
},
"comment": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "I did some work here.",
"type": "text"
}
]
}
]
},
"started": "2019-11-19T12:25:52.254+0000"
}
})
The payload is copied directly from the example in the documentation - api-rest-api-3-issue-issueIdOrKey-worklog-post. (I have tried enter here full link to the documentation, but then I was not able to create this topic with message “Sorry you cannot post a link to that host”, which I do not understand why, when the domain was atlassian com ).
But this request returns error:
Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.WorklogJsonBean out of START_ARRAY token\n at [Source: com.atlassian.plugin.connect.plugin.auth.scope.InputConsumingHttpServletRequest$1@3a74eec1; line: 1, column: 1]
It seems, that the JSON payload has something missing or so, but as I stated, it is exactly the same as in the docs, so what could be wrong?