Project

General

Profile

Actions

Feature #35839

open

API: Unable to distinguish between user and group, for the assigned_to field

Added by Aed Art over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

The `assigned_to` field for the `issues` resource, and the `default_assignee` for the `projects` resource return either a reference to an existing user or a group.
Yet, it's not possible to distinguish whether it is one or the other - at least not an easy one via the API.

Developers might have to perform additional requests to be API, in hopes of being able to determine if it's user reference or a group. This might not be as easy as it sounds. You only have the name to match against, which depending on display setting, a user's name will be outputted differently in the reference, making it a bit frustrating attempting to compare against.
Furthermore, there is always a change that a group shares the same id as a user (do not have enough understanding of the database schema)?

Possible Solution

Add a new property to the `assigned_to` and `default_assignee` references, indicating exactly it's type.
E.g:

{
  "assigned_to": {
    "id": 1234,
    "name": "Development Group",
    "type": 'group',
  }
}

{
  "default_assignee": {
    "id": 1234,
    "name": "James T. Brandon Jr.",
    "type": 'user',
  }
}
Actions

Also available in: Atom PDF