Hi everyone,
First, we sent a request to the following endpoint:/rest/api/3/field
In the response, we confirmed that the field exists and received the following field definition:
However, when we tried to send a request to the following endpoint:
"/rest/api/3/customFieldOption/customFieldNumber"
we received the following error response:
We would appreciate your help in understanding why this is happening and how we can retrieve the options for this custom field.
Additionally, we are using the following endpoint to get field information per project:"/rest/api/3/issue/createmeta?projectKeys=SCRUM&expand=projects.issuetypes.fields"
However, this approach may lead to performance issues when dealing with multiple projects, since we have to query each one individually.
Is there a more general endpoint that allows us to retrieve field information (such as custom field options) without iterating through every project separately?
Hey @Ömer Karabaş
You may use Get custom field options (context) to get the options for a given field. Here, you need to provide the custom field ID as well as the context ID.
You can get the context ID by editing the context of a custom field. The URL format is:
https://site-name.atlassian.net/secure/admin/ManageConfigurationScheme!default.jspa?atl_token=<token value>&customFieldId=10007&fieldConfigSchemeId=10107
Here, the fieldConfigSchemeId is the context ID.
Sample Request:
https://<site-name>.atlassian.net/rest/api/3/field/customfield_10007/context/10107/option
Sample Response (Repair, Upgrade, Maintenance etc being the options for this field):
I hope this helps...
Thanks!
Welcome to the community.
It appears that Get custom field option returns a specific option details from the custom field, not the entire list of options. Therefore, the parameter it receives is the ID of that option, not the ID of the custom field.
Get custom field option
Returns a custom field option. For example, an option in a select list.
It makes more sense to request the cf option lists by specifying the project since a single custom field can have different option lists for each project based on the context scheme. Therefore, you need to provide the project as an input.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Firstly thanks for comment. There is no way for all selection with api. Am i right ? Because custom field is special of project.
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.