I have a Java project in which I’m trying to interact with our Jira Cloud Platform. The current task that I’m working on is to insert a comment on a ticket using /edit endpoint. I know there is an endpoint just for inserting comments, but I want to use /edit endpoint.
Based on Atlassian Example it should be pretty straight-forward. We should send a PUT request with the following body:
{
"update": {
"comment": [
{
"add": {
"body": "It is time to finish this task"
}
}
]
}
}
I create the exact same body in my Java code like this:
but now I get 500 (internal server error). I’m assuming that this should be a pretty simple thing to do, I was surprised not being able to find anything online and Atlassian example seems to be inaccurate! Appreciate any help here.
I think it would be very beneficial and way less confusing to have these examples for both Jira service and Jira cloud, specially for the latter since the ADF is less intuitive at least for those who haven’t worked with it.
Adding a comment with edit endpoint should be very trivial thing to do but because I couldn’t find any proper explanation online, it took me a few days whereas for changing assignee of a ticket that I did in less than 5 minutes! The only difference between these two was that I could figure how to do the latter using Jira’s documentation but not the former!