Identifying Jira Issue+Request Comments Created by our own app

Our app would like to identify Jira comments it has created, as opposed to those Jira users have created. We act as a proxy by impersonating Jira users when possible, so we can’t use the author field AFAIK.

We are evaluating whether we can add some metadata to a comment on creation, such that we can read it back and know which comments are ours.

On the Issue Comments API, the properties field (aka EntityProperty) is the perfect solution for us. We can set the property we want, then when we read the comment later, we can verify that the comment was created by us.

Sadly, there doesn’t seem to be the same API on the Request Comments API for Jira Service Management. We need to support both Issue Comments and Request Comments.

Does anybody know if there’s a way to set EntityProperties on Request Comments?

Are there any plans to support it in the future, for parity between Issue Comments and Request Comments?

And lastly, does anyone know an alternative solution to the initial problem statement?

Additionally, it seems that Jira Server does not support the same API as Cloud. With Cloud, you can set properties on Comment Creation, whereas with Server, you need to use two calls: Create Comment, then Set Property.

This won’t work for us, because we’re essentially trying to avoid a race condition between posting our own comments and Jira webhooks for those comments.

Any suggestions are much appreciated.

Welcome to the Atlassian developer community, @CameronHashemi.

I wonder if you could elaborate on the user perspective of “know which comments are ours”. Why should your app treat these different from user-generated comments?

Also, from your 2nd comment, I wonder if you are trying to find a solution that will work simultaneously for both Server and Cloud? I generally advise against this. I recommend treating Server and Cloud as if they were different products because the APIs and extensibility mechanisms are most certainly on divergent paths. Indeed, this is true for many other aspects of the products outside of the developer experience. I know there are active Marketplace partners here who may have advice about maintaining shared code bases across Server and Cloud, so if anyone can help you, they are here. However, I fear the combination of constraints (Server + Cloud and knowing the source of comments) will make the problem nearly impossible to solve.

Thank you for your informative response @ibuchanan.

We have an app that performs a two-way sync between comments on our app’s tickets and Jira Issues/Requests. The problem is that when we post a comment to Jira, Jira fires a “comment created” webhook back to us. We should ignore those comments created by us, otherwise we end up with duplicated comments.

We currently solve this by “linking” our comments to Jira comments. If there’s an existing link to an inbound Jira comment, we ignore it. But the problem is that Jira sometimes fires the webhook for an inbound comment before we can store the link. It’s a race condition.

The ideal solution to this would be to store some metadata on the comment at creation, which would then serve as the signal for us to ignore our own comments. This seems possible via EntityProperties, but only for the Jira Software API.

Any alternative solutions are more than welcome!

With regards to the Cloud vs Server issue, we are doing our best to support both platforms at the same time, given our limited resources. It is indeed a source of complexity to support Jira Software + Service Desk on both Cloud and Server, but we need to support customers using each of those combinations.

We do have code that differentiates between the Cloud and Server in several places, which is expected to grow as needed. So far we are able to manage, but this specific issue is one where the distinction seems to lead us towards the “lowest common denominator” for a solution.