I'm getting a 500 error when trying to post the following comment to an issue using the API:
{
"body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is the body of the comment."
}
]
}
]
},
"properties": [
{
"key": "someKey",
"value": "someValue"
}
]
}
I know that it's related to setting the properties, because if I remove the properties block it will go through without an issue.
Can someone help me troubleshoot this?
Hi @Andrés Catalán ,
there is a special endpoint for setting comment property, I believe you need to send two requests (first for the addition of comment, second for setting some property for it).
The thing is that, at least in theory, it should be possible to make it with one call.
See here. In the Add Comment call, there are two body parameters, called properties and Additional Properties, explicitly mentioned that should get the job done, but there is no explicit guidance on how to use them.
There is, however, I believe, a glimpse of an example of the syntax under the example for Edit Issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've tried it and I wasn't able to make it work. Syntax seems to be right, but it is not working. I would recommend you to send two separate requests, there are also similar endpoints for issues and users to set property, so I think this is the recommended way. If it is not possible for you, please try to contact Atlassian support, it could be bug, but I'm not sure about it. Thank you.
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.