Get custom field contexts - not found returned

Hi.
I’m calling GET /rest/api/3/field/{fieldId}/context to get the context of a custom field.

It works fine for global custom fields but as soon as I try and access the context of a custom field that has a scope for a particular project it returns a 404 not found instead.

The docs https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-contexts/#api-rest-api-3-field-fieldid-context-get only say that global permission is required and I’m being granted the the OAuth scope manage:jira-configuration so I’m wondering what else I need to do to gain access?

Many thanks in advance.

1 Like

Hi Joel. This API only works for classic projects - so projects scoped entities won’t be returned - hence 404.

1 Like

Thanks for the fast response.

Is there an easy way to tell from the documentation which APIs work with classic projects and which work with nextgen projects? Just so I don’t make the same mistake again.

Also, is there an alternative API I can use instead?
I previous retrieved a list of custom fields from the API and the field I was interested in has a schema type of ‘option’. I was wanting to find out what the acceptable values are for that option as I’m guessing if I try and POST an unknown value to that custom field it will throw an error.

Thanks again

1 Like

Hi @TomaszZasada I was wondering if you had an update please of any ideas about how best to achieve this with a nextgen project? Many thanks

For anyone else that may be having the same problem, one potential workaround is to use,

https://api.atlassian.com/ex/jira/${clientId}/rest/api/3/issue/createmeta?expand=projects.issuetypes.fields

Hi,

Well unfortunately there’s no obvious way to distinguish APIs that work with classic projects only from the rest. However, it should be stated in the documentation.

There’s no other API to return context for a custom field however, you can obtain partial data of the custom field’s context (e.g. default value) with mentioned get create issue metadata.