How do you set a comment property using the JIRA REST API?

DJ Marcaida January 20, 2015

I'm trying to use the PUT version of this resource:

/rest/api/2/comment/{commentId}/properties/{propertyKey}

Although it is a PUT, I don't know where to specify the property and its value.

Can someone help me out?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2015
DJ Marcaida January 25, 2015

Thank you for your answer. This is different though. I successfully stored a value using JSON format. However, since it is JSON, the value stored is in the form of {value}. It's enclosed in brackets. I'm gonna try to store the value directly.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2015

Can you put your JSON here? Probably the issue is with the format itself...

DJ Marcaida January 25, 2015

I'm using HTTPBuilder with Groovy and I'm passing a list (e.g. [42]) as the body of the request. In JSON form, I assume that will be {42}. So, the body of my request is {42}, however, the PUT method does not remove the brackets when it stores the value to the comment property. I am using JSON as my content type though. So, maybe change that to TEXT or URLENC?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2015

From the example I have mentioned in my answer: { "update": { "comment": [ { "add": { "body": "It is time to finish this task" } } ] } } "It is time to finish this task" <- this is what you have as {42} ? Content type is not important here, afaik. The important is the JSON you PUT (as-is). Do, check what exactly get's posted. Seems like a problem on a groovy side, not Confluence REST API

DJ Marcaida January 28, 2015

OK , thank you. I will check on it and will post it here.

DJ Marcaida February 11, 2015

I'm adding a property to an existing comment, so it might be different. Anyway, if I send { 484 }, the value of the property becomes { 484 } and not 484.

TAGS
AUG Leaders

Atlassian Community Events