Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

customfield does not work from JQL in Python

Ben Manifold
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 5, 2025

Using the python library to send a JQL string like this to jira fails with a 400 permissions error, despite the field existing, and the service account having full administrative permissions.

"project = Foo AND status = 'BAR' AND customfield_12998 = Regular"

are custom fields not supported in jql? If not we need a workaround that can be run from the python client.

3 answers

0 votes
Stephen.Lugton
Community Champion
May 6, 2025

Hi @Ben Manifold 

Custom fields in that format are used in smartvalues for automation, when creating a JQL string you should use the field name, e.g.:

project = Foo AND status = 'BAR' AND MyFieldName = Regular

or if your field name is a text field you should use ~ instead of =

project = Foo AND status = 'BAR' AND MyFieldName ~ Regular

I would suggest testing the JQL in a Jira filter and then just copying that into your python client

 

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2025

Hi @Ben Manifold 

In python you should just be able to mention the name of the field as it is named in Jira

0 votes
Tuncay Senturk
Community Champion
May 5, 2025

Hi @Ben Manifold 

Custom fields are absolutely supported in JQL. 200 error indicates a bad request, even for admin accounts. It may be due to field value mismatch, so I'd suggest checking the exact value using the Jira UI. First test the JQL in Jira UI.

The customfield_12998 may not be available in the context for the project Foo.

Last but not least, check the encoding while sending via Python. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events