V3 endpoint:
/rest/api/3/issue/MAB-4/transitions'
V3 request body (copy-pasted from docs):
{
"update": {
"comment": [
{
"add": {
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Bug has been fixed",
"type": "text"
}
]
}
]
}
}
}
]
},
"transition": {
"id": "61"
}
}
Doing a POST request to the above endpoint results to this (with a 404 status code):
{"errorMessages":[],"errors":{"comment":"Comment body is not valid!"}}
With v2 API, transitioning an issue with a comment works fine, i.e.,
Endpoint:
/rest/api/2/issue/MAB-4/transitions
Request Body:
{
"update": {
"comment": [
{
"add": {
"body": "Eto ay comment gamit ang v2 API"
}
}
]
},
"transition": {
"id": "61"
}
}
Hi, all!
I had the same issue and I found the solution on a similar post here on the community:
https://community.atlassian.com/t5/Jira-questions/add-a-comment-while-changing-issue-status-by-REST/qaq-p/590930
It turns out you are only able to "update/add" a comment trough API transition when you require a comment also on the UI!
I've managed to make it work with the api v3 using the same solution.
I've added an empty screen on the transition and a field required validator for the comment (the second one is not mandatory, probably, but I needed it for my workflow)
when you require a comment also on the UI
What do you mean by the above?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Justin!
If you add an empty screen to your transition, a pop up will show during the transition with a "comments" field, similar to the one on the main issue screen, enabling the input of a comment during the transition.
The comment made on that pop up is effectively added the issue on the 2o step of the transition post-functions.
To see the parts that a I mention above, these are the steps, at least for Jira Cloud:
When you try to transition the issue using the configured transition, the mentioned "Comment" popup will show.
If that pop up shows using the graphical interface (UI), then you should be able to update de comment during the API transition, too!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same issue here, transition is triggered but no comments are added.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same issue. I'm getting error 400, bad request. My request looks exactly like your example
UPDATE:
I have managed to get the transition to fire, but the comment is not posting. On v2 (separate subject), I'm unable to get the "visibility" to set, even though the request goes through.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.