Hi all,
I’m currently facing an intriguing issue related to adding a worklog property with a new worklog on the Atlassian platform and would greatly appreciate your insights.
The problem arises when I try to set a key value directly. Here’s the code snippet I’m using:
// POST https://site.atlassian.net/rest/api/2/issue/KEY-123/worklog
{
"started": "2023-06-12T08:00:02.000+0000",
"timeSpentSeconds": 3600,
"properties": [
{
"key": "account",
"value": "a"
}
]
}
Upon executing this, I encounter a 500 Internal server error, which is quite perplexing.
Interestingly, if I nest the value, the operation proceeds without any hitch, and I receive a 201 Created response:
// POST https://site.atlassian.net/rest/api/2/issue/KEY-123/worklog
{
"started": "2023-06-12T08:00:02.000+0000",
"timeSpentSeconds": 3600,
"properties": [
{
"key": "account",
"value": {
"type": "a"
}
}
]
}
Even more curious is that when I add a worklog property in a separate API call, I can set the value directly without resorting to any nested workaround:
// PUT https://site.atlassian.net/rest/api/2/issue/KEY-123/worklog/WORKLOGID/properties/account
"a"
Given these observations, I was wondering if anyone else has experienced this inconsistency? Is it a recognized issue or bug within the platform? If so, could you kindly point me in the right direction? Alternatively, are there any other workarounds that would enable me to directly set the key’s value in the initial context?
This behaviour is observed with both the v2 and v3 of the Jira Cloud REST API.
Thanks in advance!
Rick