How to use JIRA REST API to fetch the issues in Json from the JIRA?

This question is in reference to Atlassian Documentation: How to export JIRA application issues to JSON

I am very new to JIRA and REST. I googled it and learned few things. In most of the code snippet I saw it uses the localhost URL to get an issue, how do API JIRA response from localhost ?.
Also in some example I saw the URL like ( on this I can see JSON response to it but when I am trying access my issues with the same URL I don't see JSON response for it. eg: my issue URL is ( on this I can my issues on GUI but when accessing API URL ( I get a response 

{"errorMessages":["Issue Does Not Exist"],"errors":{}}.


Can someone please help on this ? 

1 answer

0 vote

The example you've found looks wrong to me.

Try the same url, but with no .json on the end.

Hi Nic,

The URL didn't work in that way as well. I am using a sample code and URL ( on which i am getting a json response but code doesn't work on line final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");

Below is my code(Source Google).


import java.util.Arrays;
import java.util.Collection;

public class Example1 {
public static void main(String[] args) throws URISyntaxException {
final JiraRestClientFactory factory = new JerseyJiraRestClientFactory();
final URI jiraServerUri = new URI("");
final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");
final NullProgressMonitor pm = new NullProgressMonitor();
final Issue issue = restClient.getIssueClient().getIssue("TST-1", pm);


// now let's vote for it
restClient.getIssueClient().vote(issue.getVotesUri(), pm);

// now let's watch it
restClient.getIssueClient().watch(issue.getWatchers().getSelf(), pm);

// now let's start progress on this issue
final Iterable<Transition> transitions = restClient.getIssueClient().getTransitions(issue.getTransitionsUri(), pm);
final Transition startProgressTransition = getTransitionByName(transitions, "Start Progress");
restClient.getIssueClient().transition(issue.getTransitionsUri(), new TransitionInput(startProgressTransition.getId()), pm);

// and now let's resolve it as Incomplete
final Transition resolveIssueTransition = getTransitionByName(transitions, "Resolve Issue");
Collection<FieldInput> fieldInputs = Arrays.asList(new FieldInput("resolution", "Incomplete"));
final TransitionInput transitionInput = new TransitionInput(resolveIssueTransition.getId(), fieldInputs, Comment.valueOf("My comment"));
restClient.getIssueClient().transition(issue.getTransitionsUri(), transitionInput, pm);


private static Transition getTransitionByName(Iterable<Transition> transitions, String transitionName) {
for (Transition transition : transitions) {
if (transition.getName().equals(transitionName)) {
return transition;
return null;



You are using the wrong url.  Your code is irrelevant if you are looking at the wrong url.

Remove the .json


Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

285 views 38 9
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