chatrapathi
chatrapathi

Reputation: 117

unable to perform search on custom_field(JIRA-Python)

I'm getting the below error when I search on custom_field.

{"errorMessages":["Field \'customfield_10029\' does not exist or you do not have permission to view it."],"warningMessages":[]}

URL = 'https://xyz.atlassian.net/rest/api/2/search?jql=status="In+Progress"+and+customfield_10029=125&fields=id,key,status'

Upvotes: 1

Views: 737

Answers (2)

jgtrz
jgtrz

Reputation: 375

I get a 400 response code with customized field syntax: https://domain/rest/api/2/search?maxResults=500&jql=cf[10025]='xxxxxxxxxd'&fields=id,key,issuetype,status,customfield_10025

Upvotes: 0

David Bakkers
David Bakkers

Reputation: 555

Custom fields in JQL searches are referenced using the abbreviation 'cf' followed by their ID inside square brackets '[id]', so your URL would be:

URL = 'https://xyz.atlassian.net/rest/api/2/search?jql=status="In+Progress"+and+cf[10029]=125&fields=id,key,status'

Make sure you properly encode the square brackets in UTF-8 format in your language's encoding method.

PS. Generally speaking, it's much easier to reference custom fields in JQL searches by their names, not their IDs. It makes the search URL easier to read and understand what is being searched for.

Upvotes: 2

Related Questions