Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Posting an Issue Comment through Rest API

edgar.polancogomez January 20, 2021

Im trying to post a comment issue through the JIRA Rest API v2 which was working fine before, but now it's not adding the comments anymore. However, I noticed I'm receiving now a `200 Response Code` which doesn't appear as a valid option in the documentation.

This is how I am trying to post the comment:
POST mydomain.atlassian.net/rest/api/2/issue/PLAYG-704/comment

and this is what Im getting https://clb.sh/552fd0

After doing tests on another ticket which had comments, it seems to me that it's behaving like if I am sending a GET request (which returns 200) instead of POST (which returns 201)

https://clb.sh/41c73a

Has anyone seen something similar?

 

Thanks in advance

 

2 answers

0 votes
Mark Ahnell
Contributor
September 2, 2024

@edgar.polancogomez , did you ever fix this issue?  Im getting the same thing, response code 200, and it just returns:

{
    "size": 0,
    "start": 0,
    "limit": 50,
    "isLastPage": true,
    "values": []
}
Mark Ahnell
Contributor
September 3, 2024

Hopefully this will save time to anyone that runs into this.  I was using http instead of https. So in Postman, I would submit, and it would redirect the request from http to https.  When it did the redirect, from http to https, it changed the request to a "GET" rather than a "POST".  This is why I was getting a "200", because I was getting a "200" on the GET request, which would return the comments for that issue. 

0 votes
Hana Kučerová
Community Champion
January 20, 2021

Hi @edgar.polancogomez ,

I've just tested it and it works for me. It is really strange you're getting code 200.

Have you tried to use API v3 instead of v2?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events