Hello,
is there a way how to get or set comment reactions in REST API? This feature is in web app for quite a long time, but there's no mention of it nowhere in API docs.
Thanks!
Hi @Radim,
there are undocumented API for Data Center/Server
/rest/internal/2/reactions [GET, POST, DELETE]
And for Cloud:
/gateway/api/reactions/reactions [GET, POST, DELETE]
That could be used for this.
@Andrea Pannitti can you provide more information, or a link to where you found this? I get a 401 error when trying to access the api you gave for the Cloud, and I can't find any documentation or examples that use /gateway/api/.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Brent Jenkins ,
I'm sorry I couldn't answer earlier; anyway, try adding the following header to your request:
X-Atlassian-Token: no-check
In the body you have to specify: emojiId, ari and containerAri; for an example, check the network traffic from the console of your browser when you add a reaction manually.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your tips and suggesting that header! Unfortunately I still get a 401 unauthorized error. While inspecting the network traffic doing it manually, it appears this api is still using cookie-based authentication. However, that authentication method has been deprecated by Jira for third party clients. So, it doesn't seem like there's a way to access this API any more? Maybe if I use an Admin API token with basic auth instead of a user token it would work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Brent Jenkins ,
Why not get a valid cookie from a browser session and use that? I mean since you are already working with undocumented APIs at this point, you might as well start doing the really hackish solution ;-)
Seriously though, the way I would approach this is to look into the browser's web developer tools and then try to mimic what is going on there – including the cookie session. You'd be surprised how often this approach brings stable results.
Hope that helps,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Oliver Siebenmarck _Polymetis Apps_ thanks for the suggestion! I guess I should have mentioned I am trying to connect to this API using Jira Automation with the Send Web Request action.
I'm trying to make it easy for people to locate issues where they have been @mentioned in the most recent comment, so they can remember to respond. To do this, I have set up an automation rule triggered by every new comment that parses the comment's body for any @mentions. When it finds one, it sets the value of a custom user field as the same user that was mentioned. Now people can use a filter to query for issues on that custom field to find the ones where they were the most recently mentioned user.
The annoying thing about this is a lot of @mentions are simply to notify that specific person about something, and don't require a response. In those cases, it's natural for that mentioned person to simply add a reaction to that comment to acknowledge they have read it. So, I want to be able to detect when that comment has a reaction on it so I can clear my custom user field.
Happy to provide more details, if anyone would like.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Brent Jenkins ,
Thanks for elaborating! That is indeed quite an interesting and very specific use-case.
Because I was intrigued, I did some research on this. Frankly, I came up empty. With Automation, you can get triggers on creating or editing comments, but not for reactions. That's pretty much the same events that are available to Connect apps.
When there's no event trigger, one can of course always use a regularly executed automation based on a JQL query and some condition. Unfortunately, you do not get any information about comment reactions in the Smart Values of Automation.
Finally, I wondered whether one could use Jira Expressions to get information about reactions. Here too, there's nothing to be found.
At this point I gave up – I guess you can upvote https://jira.atlassian.com/browse/JRACLOUD-78153, but apart from that I have no idea on how one would implement your use-case in a sensible manner.
Best regards,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Radim ,
I would suggest you create a suggestion for Atlassian to get or set comment reactions in REST API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a suggestion for JIRA REST API here: https://jira.atlassian.com/browse/JRACLOUD-78412. Please revise and vote for it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.