Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,440
Community Members
 
Community Events
168
Community Groups

REST API Endpoint for customfield_number is not empty

I'm working on a get request that gives me all JIRA issues with the custom field "Sponsor". Since it's an optional field, the value is often empty. So out of all issues in a JIRA project, how can I extract those who have a sponsor? My query looks like this so far

https://jira.companyname.com/rest/api/2/search?jql=project=projectname&maxResults=1000

What is missing? I do know the customField name and id.

I tried

jql=project=projectname&maxResults=1000&customfield_number!%3DEMPTY

and

jql=project=projectname&maxResults=1000&customfield_number!%3Dnull

But it didn't work

1 answer

1 accepted

1 vote
Answer accepted
Tessa Tuteleers Community Leader Aug 17, 2022

Hi @Miraculous Ladybug , 

Welcome to the community!! 

You can just add it to the JQL query param normally:

Project = yourProject AND yourNumberField is not EMPTY

 

Hope this helps! 

- Tessa

Thanks Tessa :) My problem is that I'm writing the query in my URL and not in code.  I don't quite understand how I can write this in my URL... Do you have an idea?

Tessa Tuteleers Community Leader Aug 18, 2022

Hi @Miraculous Ladybug , 

I haven't run this particular one, but normally you just have to encode the params to use the in URL. You can use sites to do this for you like urlencoder.org. 

Depending on how you are running the call there are other ways ofc. 

- Tessa

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events