Forums

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

EXCLUDE all customfields from query output

Andy Hint February 16, 2018

Hi,

I am attempting to do a extract a lot of data relating to the projects, issues, changelog from a jira instance.  However, I do not need any information relating to any of the custom fields (which make up the bulk of the output).  

 

current query-->  https://servername.com/rest/api/2/search?fields=*all&jql=project=NAME&startAt=0&maxResults=500&expand=changelog

 

I was hoping to exclude 'customfield' ... as in 

possible query --> https://servername.com/rest/api/2/search?fields=*all,-customfield&jql=project=NAME&startAt=0&maxResults=500&expand=changelog

 

exclude.PNG

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.0/#api/2/customFieldOption-getCustomFieldOption

Not successful ...

Any advice or suggestions are appreciated... searched this database for possible solutions... but saw questions on how to include certain fields... but, I am looking for just about everything but customfields (project, issuetype, status, resolutiondate, timestimate, component, duedate....)

Regards,

4 answers

2 votes
Malloy Maddigan August 22, 2018

I don't think you can exclude fields, however restricting the fields to the ones you want should be doable as in:

https://servername.com/rest/api/2/search?jql=project=NAME&startAt=0&maxResults=500&expand=changelog&fields=project,issuetype,created,updated,status,summary,resolutiondate,priority,reporter,assignee,duedate,resolutiondate,timeoriginalestimate,timeestimate,timespent,components

1 vote
Andy Hint February 22, 2018

looking for ideas...

0 votes
Stephen O'Neill
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!
October 2, 2018

Malloy's suggestion of whitelisting fields works for me. I also noticed this in the documentation:

"A particular field can be excluded by prefixing it with a minus."

e.g.

-description - include navigable fields except the description (the default is *navigable for search)

https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/?_ga=2.104567296.1459862253.1538472227-612334186.1536238394#api/2/search-search

Mark Ahnell
Contributor
February 16, 2024

For excluding custom fields, I wanted to do this also, but the only way I could figure it out was adding each of the custom fields as a "-".  Loooong URL, but it works:

&fields=-customfield_13102,-customfield_13102,-customfield_13104

... and so on.  

Was hoping &fields=-customfield_* would work, but it does not. 

0 votes
Andy Hint February 16, 2018

quick update --> below are the 'fields' I am looking for

project

issuetype

created

updated

status

summary

resolutiondate

priority

reporter

assignee

duedate

resolutiondate

timeoriginalestimate

timeestimate

timespent

components

 

A lot of 'fields'... but none of the custom fields ... :)

Andy Hint February 21, 2018

any thoughts....

Suggest an answer

Log in or Sign up to answer