How do I read "Issues in Epic" programmatically ?

Hi..

I have JIRA Agile plugin installed in my jira and i want to read "issues in epic" for a given Epic from jira listener.

Is there any API i can use to read "Issues in Epic" from jira listener?

I tried reading like a subtask as follows but it didnt help!

Collection<Issue> subtasks= issue.getSubTaskObjects();

Any help?

Thanks in Advance!!

Ohm

3 answers

This widget could not be displayed.

I even tried accessing these like issue links. That didnt help either.

This widget could not be displayed.

Looks like i found one workaround.

These links are stored in jira database as issue links.

select * from issuelinktype gives me

/10500Epic-Story Linkhas Epicis Epic ofjira_gh_epic_story/

so, for the moment I can read it from database table issuelink by querying on linktype.

This widget could not be displayed.

This can be done on two steps:

1- Rest call

2- Extract issues from the Server Response JSON String

 

1-

public String getIssuesForEpic(long epicID) {

String ServerJSONOutput = NULL_DATA;
try{
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD));
WebResource webResource = client.resource(JIRA_URL + "/rest/agile/1.0/epic/" + epicID + "/issue");
ClientResponse response = webResource.type("application/json").get(ClientResponse.class);
log.trace("REST Response to getIssuesForEpic() = {}",response.getStatus());
ServerJSONOutput = response.getEntity(String.class);
log.trace("Output from Server .... {}", ServerJSONOutput);
} catch(Exception e){
e.printStackTrace();
}

return ServerJSONOutput;
}

 

 

2-

Use Java JSONObject to go through the issue array and convert them into issue object using IssueManager.getIssueObject(long id)

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

226 views 3 0
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