I'm trying to get all possible values for a customfield on JIRA through the GET api.
Example:
I created the "Test API" custom field and gave it three values "API 1", "API 2" and "API 3". The id for this field is 18232.
I'm trying to do this with the following:
https://my-domain.atlassian.net/rest/api/2/customFieldOption/18232
I got this from here
The headers are one for basic authorization and one with Accept - application/json
No matter what I try to do I keep getting the error
{"errorMessages":["A custom field option with id '18232' does not exist"],"errors":{}}
Has anyone been sucessful with this?
This is returning a specific option details and should work if the option id is correct.
If you want to get all the allowed values for a custom field, use the createmeta or editmeta methods. Here is an example resource:
/rest/api/2/issue/createmeta?projectKeys=YOURPROJECTKEY&issuetypeNames=Bug&expand=projects.issuetypes.fields
Thanks, you solved my issue :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin Kuruvilla, thank you!
This solved my issue partially:
/rest/api/2/issue/createmeta?projectKeys=YOURPROJECTKEY&expand=projects.issuetypes.fields
I've got all the possible values for my custom field.
My other field has a child:
type=option-with-child
The method showed above gives me all values for the main field — parent. I was not able to retrieve all values for the child. Could you please say if it possible?
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.
The upper REST call is meanwhile marked as deprecated in the REST API reference guide. To get the custom field options in the future, get first all issue types of one project:
GET /rest/api/2/issue/createmeta/{projectKey}/issuetypes
then for one specific issue type {id} the field details:
GET /rest/api/2/issue/createmeta/{projectKey}/issuetypes/{id}
The result contains the custom filed options underneath "allowedValues", if present for this issue type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Support REST Extender _Groupnet_Thank you kind sir, I was searching for this way too long, but your wisdom saved me from damnation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry to keep bringing this ticket back to life. is there away to extend this query so i can get all the values back from the customefield?
atlassian.net/rest/api/2/issue/createmeta/ABC/issuetypes/10101
gives me :
{
"required": false,
"schema": {
"type": "team",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:atlassian-team",
"customId": 10100,
"configuration": {
"com.atlassian.jira.plugin.system.customfieldtypes:atlassian-team": true
}
},
"name": "Team",
"key": "customfield_10100",
"autoCompleteUrl": "https://xyz.atlassian.net/gateway/api/v1/recommendations",
"hasDefaultValue": false,
"operations": [
"set"
],
"fieldId": "customfield_10100"
},
i need the actual available options for the teams , so i can create the jira ticket with a. default team already assigned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have a look at the example above I don't have all the details and fairly jr with the JIRA API, but this worked for me:
Custom field value lookup:
To have a look in the browser (and move across to API calls), you can
xyz.atlassian.net/rest/api/3/issue/createmeta/{4LetterProjectCode}/issuetypes
This for me returns all the issue types that can be created. I wanted RFCs (id 11563) so I changed the query to
xyz.atlassian.net/rest/api/3/issue/createmeta/{4LetterProjectCode}/issuetypes/11563
The ones hat have lookups have an "allowedValues" section in the returned JSON,
<snip>
{ "required": false, "schema": { "type": "array", "items": "component", "system": "components" }, "name": "Components", "key": "components", "hasDefaultValue": false, "operations": [ "add", "set", "remove" ], "allowedValues": [ { "self": "https://xyz.atlassian.net/rest/api/3/component/10806", "id": "10806", "name": "Application Performance" }, { "self": "https://xyz.atlassian.net/rest/api/3/component/10802", "id": "10802", "name": "Automations" }, { "self": "https://xyz.atlassian.net/rest/api/3/component/10790", "id": "10790", "name": "Citrix", "description": "Hosting Platform Citrix" },
</snip>
That gave me the id and name that could be entered/used
Lookup values:
All the ones I can see have a
query=
at the end, e.g.
"autoCompleteUrl": "https://xyz.atlassian.net/rest/servicedesk/1/servicedesk/sd-user-search/participants?issueKey=null&query=",
using that query, to search for all the "Wayne"s, I'd change it to:
https://xyz.atlassian.net/rest/servicedesk/1/servicedesk/sd-user-search/participants?issueKey=null&query=Wayne
Try adding
?query=xyz
to the end of your lookups and see what you get back
Good luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.