Actions
Feature #44288
openAdd reactions to REST API responses for issues and news
Status:
New
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Resolution:
Description
Reactions were introduced in Redmine 6.1.0 (#42630), but they are not yet available through the REST API. This patch is a first step: it lets API clients read the reactions on issues and news. Adding and removing reactions via the API is not included yet.
You can now get reactions by passing include=reactions to the show endpoints:
GET /issues/:id.xml?include=reactions— reactions on the issueGET /issues/:id.xml?include=journals,reactions— reactions on each journal (note)GET /news/:id.xml?include=reactions— reactions on the newsGET /news/:id.xml?include=comments,reactions— reactions on each comment
Reactions on journals and comments are returned only when journals or comments is also requested.
Response example (XML):
<reactions type="array">
<reaction>
<user id="2" name="John Smith"/>
</reaction>
</reactions>
Response example (JSON):
"reactions": [
{ "user": { "id": 2, "name": "John Smith" } }
]
Each reaction is wrapped in a <reaction> element (rather than listing users directly, like watchers does) so that more fields can be added later — for example a reaction type — without breaking backward compatibility.
Some notes:
- Reactions are only included when explicitly requested with
include, so existing responses do not change. - When reactions are disabled, the
reactionselement is not returned. - Only users visible to the requester are listed, following the existing reaction visibility rules. No new information is exposed.
- The index endpoints (e.g.
GET /issues.xml) are not covered, to avoid extra queries. - Forum messages also support reactions, but they have no REST API yet, so they are out of scope.
Files
No data to display
Actions