We are implementing a different kind of interface to jira service desk. So, basically, users would hit our site, create a issue, and we push that issue over to JSD, and internally correlate the jira issue with our internal case thingie.
All that works fine.
We also use a webhook when comments are created, so that responses to the issue on jira make it back to our internal case.
And, we allow internal communication on our case to push to JSD as a comment. And this is where the problem occurs. When we hit the /rest/servicedeskapi/request/${param.issueKey}/comment
endpoint with a POST to create a comment, we save the comment.id to correlate our internal comment with the jira issue comment. We do this for updates, but, most importantly, we do it to prevent dupes. Because when we create the comment, we still get the webhook response.
But, the webhook arrives before the POST response does. So, we do not have the id yet, and we end up with duplicate responses.
Any thoughts on how to get around this? I mean, I could add an internal delay to the webhook processing code, but, that sounds really hacky.