How to get specified column to display via jira rest api

hi, i use jql to get a list of basic issue items, and i want to display specified columns, like "Summary", "Created data", "Reporter", how to do this? Thanks in advance:)

my code is here

public static void main(String[] args) throws URISyntaxException {
		final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
		final URI jiraServerUri = new URI(JIRA_URL);
		final JiraRestClient restClient = factory
				.createWithBasicHttpAuthentication(jiraServerUri,
						USER_NAME, PASSWORD);
		final NullProgressMonitor pm = new NullProgressMonitor();
		System.out.println("Initial done");
		String jql="status in (Open, \"In Progress\") AND created >= 2014-07-29 AND created <= 2014-07-30";
		SearchResult sr = restClient.getSearchClient().searchJql(jql, pm);
		ArrayList<BasicIssue> issueList = (ArrayList<BasicIssue>) sr.getIssues();
// Now i can get all the issues, how can i get specified attribute, like "Summary", "Created date", or "Reporter"? I can only find the "key" attribute in BasicIssue
	}

1 answer

Hi Ning, You can iterate the issues coming from the SerachRequest. If you have aware of jira api, you can use the below code snippet,

SearchResult sr = restClient.getSearchClient().searchJql(jql, pm);

for(BasicIssue basciIssue:sr.getIssues()){

MutableIssue issue=ComponentAccessor.getIssueManager().getIssueObject(basciIssue.getKey());

//From this issue you can get the all issue details

issue.getSummary();

issue.getCreated();

issue.getReporterUser();

}

Hope may this helps you.

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 ...

3,300 views 14 20
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