Project

General

Profile

Actions

Defect #38668

closed

Unable to retrieve custom fields set as "For all projects" via Projects API

Added by Hirokazu Onozato over 1 year ago. Updated over 1 year ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Create a custom field for the Issue and check "For all projects".

When retrieving Issue custom fields in the Projects API, those with "For all projects" checked will not be retrieved.

<projects total_count="2" offset="0" limit="25" type="array">
  <project>
    <id>1</id>
    <name>a</name>
    <identifier>a</identifier>
    <description/>
    <status>1</status>
    <is_public>true</is_public>
    <inherit_members>false</inherit_members>
    <issue_custom_fields type="array">
      <custom_field id="2" name="Per Projects"/>
    </issue_custom_fields>
    <created_on>2023-06-07T09:45:45Z</created_on>
    <updated_on>2023-06-07T09:45:45Z</updated_on>
  </project>
  <project>
    <id>2</id>
    <name>b</name>
    <identifier>b</identifier>
    <description/>
    <status>1</status>
    <is_public>false</is_public>
    <inherit_members>false</inherit_members>
    <issue_custom_fields type="array"/>
    <created_on>2023-06-07T09:45:57Z</created_on>
    <updated_on>2023-06-07T09:45:57Z</updated_on>
  </project>
</projects>

I thought it should also be possible to retrieve those specified in "For all projects."
I have confirmed that the following modification will result in the intended behavior.


Files

clipboard-202306071920-mez0o.png (32.6 KB) clipboard-202306071920-mez0o.png Hirokazu Onozato, 2023-06-07 12:20
clipboard-202306071923-sjvfc.png (13.2 KB) clipboard-202306071923-sjvfc.png Hirokazu Onozato, 2023-06-07 12:23
projects_helper.rb.diff (594 Bytes) projects_helper.rb.diff Hirokazu Onozato, 2023-06-07 12:28

Related issues

Related to Redmine - Feature #33301: Add option to include enabled issue custom fields in projects#show API responseClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF