API Adding a comment with a transition message

When I use the API to apply a transition I don't seem to be able to attach a comment to the issue altough the API documentation clearly says I should be (https://docs.atlassian.com/jira/REST/latest/#idp2074672)

Here is the JSON I'm trying to send via POST:

    "update": {
        "comment": [
                "add": {
                    "body": "Some comment"
    "fields": {
    "transition": {
        "id": "1"

The issue is being moved without problems and I don't see any errors in the response either, it feels like the method is just broken. Any suggestions? Thanks!

7 answers

1 accepted

This widget could not be displayed.

It seems the problem resolved itself although I haven't touched the code in a while. It was possibly a temporary issue with Atlassian's webservice. Thanks for the suggestions anyways.

Actually, the problem that you mention is still valid, I couldn't add comment while doing the transition.

This widget could not be displayed.

i can able to add comment with your JSON which is

{ "update": { "comment": [ { "add": {"body": "Bug has been fixed."} }]},"fields": {}, "transition": { "id": "21" }}

how your trying to update? if you are using any client can you post your client code?

This widget could not be displayed.

I got the same result using a browser-based REST client like postman and writing an API service myself. I doubt it has anything to do with client code as the issue is being transitioned just fine. I also double checked the API user permissions and it does have right to insert comments. Is it possible that I need to enable something in the settings to make it work?

This widget could not be displayed.

the following client code i have used test REST

package com.rest.client;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;

public class RESTclient {

	public static void main(String[] args) {
		try {
			Client client = Client.create();			
			client.addFilter(new HTTPBasicAuthFilter("admin", "admin"));
			WebResource webResource = client.resource("http://LOCALHOST:8080/rest/api/2/issue/JIRA-100/transitions");		
		String input="{ \"update\": {\"comment\": [ { \"add\": {\"body\": \"Testing.\"} }]},\"fields\": {}, \"transition\": { \"id\": \"21\" }} ";	
			ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);	
			String output = response.getEntity(String.class);
			System.out.println("Output from Server .... \n");
		} catch (Exception e) {


This widget could not be displayed.

I still believe it has nothing to do with client, but anyways here is my code:

http = Net::HTTP.new API_HOST, 443
http.use_ssl = true
req = Net::HTTP::Post.new "/rest/api/2/issue/JIRA-123/transitions", initheader = {'Content-Type' =>'application/json'}
req.basic_auth USERNAME, PASSWORD
# Load in request body template file
renderer = ERB.new File.new("transition.erb").read, nil, "%"
# Substitute variables with values and set result as the body
req.body = renderer.result
http.start do |http|
  response = http.request req

Also note that I'm using ondemand so it might has a slightly different configuration.

This widget could not be displayed.

Im experiencing this issues as well, is there a fix?

This widget could not be displayed.
Evan Wolf I'm New Here Aug 08, 2018

I would love a resolution to this issue!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

97 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you