Project

General

Profile

Actions

Feature #44288

closed

Add reactions to REST API responses for issues and news

Added by Go MAEDA 21 days ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
REST API
Target version:
Resolution:
Fixed

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 issue
  • GET /issues/:id.xml?include=journals,reactions — reactions on each journal (note)
  • GET /news/:id.xml?include=reactions — reactions on the news
  • GET /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 reactions element 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

Actions #1

Updated by Go MAEDA 16 days ago

  • Target version set to 7.1.0

Setting the target version to 7.1.0.

Actions #2

Updated by Go MAEDA 1 day ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r24888.
I will update the API Wiki pages later.

Actions #3

Updated by Go MAEDA 1 day ago

  • Status changed from Resolved to Closed

Go MAEDA wrote in #note-2:

I will update the API Wiki pages later.

I have updated Rest_Issues and Rest_News.

Actions

Also available in: Atom PDF