plane icon indicating copy to clipboard operation
plane copied to clipboard

[feature]: Add work item custom properties to /work-items/ API response

Open iamcheek opened this issue 9 months ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Summary

I have created some custom work item properties so that I can leverage them via some automated processes. However, I've just discovered the number of steps it takes with different API endpoints just to retrieve a single custom property value.

If I have this wrong and there's a better way to do it, I'm all ears

  1. Call list all work items API
  2. For each work item, use the work item type Id to call the List custom properties endpoint
  3. For each custom property, call the custom property values endpoint to retrieve the value

So let's say for example I have a work item type with 2 custom properties. That means if I want to retrieve the "standard" properties as well as the custom ones for a single work item, I have to make 4 separate API calls to retrieve that value

  1. GET /work-items
  2. GET /work-item-types/{type_id}/work-item-properties
  3. GET /work-item-properties/{property_id_1}/values
  4. GET /work-item-properties/{property_id_2}/values

Can there not just be a "custom_properties" object array that is attached to the response when you call GET /work-items ? That seems to be far more efficient

Why should this be worked on?

If you want more people to utilize custom properties you need to make them easier to programmatically retrieve

iamcheek avatar Feb 22 '26 19:02 iamcheek

Hi @iamcheek Appreciate the suggestion. We’re evaluating the implementation and will keep this thread posted on progress.

pushya22 avatar Feb 24 '26 14:02 pushya22

I would also find this useful.

futzlarson avatar Sep 18 '26 19:09 futzlarson

For the single-work-item case there is already a one-call answer, which doesn't seem to be documented: GET /work-items/{id}/properties/ returns the work item plus a custom_fields object, with each property's value already resolved.

"custom_fields": {
  "target-environment": {
    "id": "…",
    "type": "OPTION",
    "display_name": "Target Environment",
    "is_multi": false,
    "value": "…",
    "value_detail": { "id": "…", "name": "PROD" }
  }
}

That replaces the three property lookups: no fetching the type's properties, no per-property values call, and for OPTION types no second lookup to turn the option id into a name.

The list case is still the gap this issue describes. GET /work-items/ returns no custom_fields, so reading one property across N work items is N calls. Having the list response return the same shape /properties/ already does would close it.

Worth noting the two responses disagree in other ways too, which is its own problem for anyone switching between them: /properties/ gives state_id, assignee_ids and label_ids, while /work-items/{id}/ gives expanded state and labels objects. Related: #9534, #9594.

futzlarson avatar Sep 18 '26 19:09 futzlarson

Hi @vihar @pushya22,

I'd like to contribute to this issue.

Proposed implementation approach:

  1. Trace the existing GET /work-items/ endpoint and GET /work-items/{id}/properties/ endpoint to understand how custom field values are resolved.
  2. Reuse the existing custom field resolution logic where possible, instead of introducing duplicate logic.
  3. Update the work items list response to include a custom_fields object consistent with the existing properties endpoint, while keeping the response backward-compatible.
  4. Make sure the implementation handles work items with no custom fields and different custom property types correctly.

Verification plan:

  • Add tests to verify that the list response includes the correct custom field values.
  • Test work items with multiple custom fields, missing values, and no custom fields.
  • Check that pagination, filtering, and existing API behavior continue to work.
  • Check for unnecessary database queries when returning multiple work items, to avoid introducing N+1 query or performance issues.
  • Run the relevant API tests and required linting checks.

Before starting implementation, could you please confirm whether this feature is still planned and whether this approach aligns with the team's expectations? I'd also appreciate any guidance on the expected response structure or performance constraints.

Thanks!

Akash1xe avatar Oct 29 '26 15:10 Akash1xe