Rest call for custom fields

I am trying to use a rest call to get the custom fields in JIRA. The method I am using is "/rest/api/2/field". When I use this in the browser it returns all of the fields including the custom fields. However when I use this same method in my java project it only returns the JIRA non-custom fields. The code I am using in java follows.

String auth = new String(Base64.encodeBase64("username:password".getBytes()));

WebResource webResource = clientRest.resource("http://example.com:8080/jira/rest/api/2/field");

ClientResponse response = webResource.header("Authorization", "Basic " + auth).type("application/json").accept("application/json").get(ClientResponse.class);

String output = response.getEntity(String.class);

How do I fix this so that I can get the custom fields with this call?

1 answer

It might be a dumb question, but are you sure there are any custom fields on your developement instance? As far as I remember, a virgin dev Jira only has Jiras default fields, which would not count as customfields...

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,975 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot