I'm working on a marketplace app that creates a custom field during installation. After some painful troubleshooting, I've come to realize that, unless a Company Managed Project is present, the API call to "/rest/api/3/field" returns a subset of the fields that are present in the system. With TMP only, ~45 fields are returned, the custom field that our app creates isn't among them despite the fact that we can verify its existence at https://mytenant.atlassian.net/jira/settings/issues/fields . Once a CMP has been created, ~85 fields are returned by the API call, including the custom field in question.
Is this a bug or by design? If the latter, what's the reasoning? The custom field is passed along with the work items details for TMPs, but without a CMP present in the system we dont have a good way of identifying it.
Hey @Joel Marshall ,
Welcome to Atlassian community!
I understand you are unable to get custom field details which are created on a Team amanged project using API endpoint /rest/api/3/field.This is an expected behaviour as
GET request to /rest/api/3/field
in Jira Cloud is for the global custom field and it will not reliably return custom fields created in team-managed (formerly next-gen) projects.
The /rest/api/3/field
endpoint lists global custom fields—those available across the Jira instance and typically used in company-managed projects.
Custom fields created within a team-managed project are scoped only to that project and are managed differently. They are not global fields, so they usually do not appear in the /rest/api/3/field
response.
If you need to fetch custom fields for a team-managed project, you should use the /rest/api/3/issue/createmeta
endpoint with the relevant project and issue type parameters. This will return the fields (including custom fields) available for creating issues in that specific project
Summary Table
Endpoint |
Returns team-managed custom fields? |
Notes |
---|---|---|
|
No |
Only global/company-managed custom fields |
|
Yes |
Returns project-specific fields, including team-managed |
Recommendation:
Use /rest/api/3/issue/createmeta?projectIds={projectId}&issuetypeIds={issueTypeId}&expand=projects.issuetypes.fields
to get custom fields for a team-managed project
I hope this should help you fix the concern, have a good day!
Regards
Chitra Nagdeo
The custom field is created and managed by our Connect app, not the Team Managed Project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Joel Marshall
That's a really bizarre bug.
One of the main differences between CMPs and TMPs is that CMPs use issue screen schemes for their fields and TMPs don't, so it might be possible the API endpoint requires that a field be on at at least one screen scheme for at least one issue type for it be returned in a search. I'd be investigating the characteristics of the first ~45 returned when a CMP does NOT exist and comparing that with the 'extra' ~40 fields that are returned when a CMP does exists.
Anyhow, it's a fairly obscure scenario (I personally can't think of any company that doesn't have at least one Company Managed Project in their Jira instance) but if you've able to consistently replicate that behaviour and exhausted all possible explanations, then I recommend that you log a bug with Atlassian.
Please let us know what the outcome is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So it turns out that it is returned by calls to "/rest/api/3/field/search" regardless of which Project types are present- it even works with no projects at all so that's what we've switched to. Perhaps it's by design that app managed fields aren't returned by "/rest/api/3/field" but that certainly seems odd.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.