Update existing comment via REST API - new comment id assigned?
I am working on a POC project which will require me to sync up comments posted to/from our application and a YouTrack issue. For example, when a user enters a comment in my app, the comment will need to be written into both our application's comment repository AND also into our YouTrack issue tracking system. What I have noticed is that when I update an existing comment in YouTrack via REST API, the comment id is changed - see attachment. This creates a potential issue/complication for us, as we were expecting to sync up our comment repository with your track's comments with an out of process call; the changing of the comment id creates a timing issue where in 2 quick updates on the same comment will cause an issue due to the 2nd update not yet having a new comment issue id. See the attachment where after a PUT on an existing id, response message shows the the comment now has a new id. Am I doing something wrong? Is there a way to keep the id unchanged? I have noticed that when the comment is changed within YouTrack application rather than REST API, the id does NOT chage
Please sign in to leave a comment.
Hello, thank you for your message.
The thing is, YouTrack REST API doesn't support PUT requests. We only support updating entities via POST requests, these requests do not change IDs of the entities.
Here you can find the reference on updating issue comments: https://www.jetbrains.com/help/youtrack/devportal/operations-api-issues-issueID-comments.html#update-IssueComment-method
Let us know if you have any further questions, we'll be happy to help.
Thank you - my mistake not reading the documentation carefully. While, arguably, this may not be a classic RESTFUL API technique, using POST with an ID in the URL will work for our project purpose.