Update JIRA SD comments via REST Edited

Hello

I'm trying to get around the inability to import {{INTERNAL}} comments via CSV, as well as Cloud limitation, and came to a point where I decided to try updating them via REST API.

Documentation here says which endpoint URL to use and responses, however it doesn't provide any clues about which format PUT should be!

I tried various ways, from this

def setComment = put("/rest/api/2/comment/${commentId}/properties/sd.public.comment").body('{
"key": "sd.public.comment",
"value": {
"internal": false
}
}')

to this

def setComment = put("/rest/api/2/comment/${commentId}/properties/sd.public.comment").body('{internal: false}')

But none of them works. Would appreciate any help on this.

2 answers

0 votes

Hi cPrime - since this is development related, you might want to try asking this over at: https://community.developer.atlassian.com as well (if you haven't already).

There's a lot of helpful and experienced people over there and you might well get a quicker answer in there than on here.

Thanks, will do next time — there just a lot of changes which we didn't get used to yet.

The solution appears to be more simple — just set header and 

def setComment = put("/rest/api/2/comment/${commentId}/properties/sd.public.comment")
.header('Content-Type', 'application/json')
.body([internal: true])
.asString()

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,863 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot