Forums

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

How by jql to get issues in the form of JSON from JiraServer using java?

Oleksii Skachkov
Contributor
May 14, 2020

Hi all!

I am developing a plugin and I have the next problem:

- I retrieving from a user a JQL string like this: "project = DEMO"

- then I want to retrieve JSON with issues, but I can retrieve only List<Issue>

example:

String query = "project = DEMO";
Query conditionQuery = jqlQueryParser.parseQuery(query);
ApplicationUser searcher = jiraAuthenticationContext.getUser();
SearchResults results = searchService.search(searcher, conditionQuery, PagerFilter.getUnlimitedFilter());
List<Issue> issues = results.getIssues();

 

Object SearchResult is similar to JSON, retrieving from the link:

http://localhost:2990/jira/rest/api/2/search?jql=project+%3D+DEMO

This JSON is what I need. But I can’t understand how I can get it. Maybe somebody can give me advice - how to convert SearchResult to JSON, or maybe there is another way to get the JSON I need?

1 answer

2 votes
Deleted user
June 3, 2016

Suggest an answer

Log in or Sign up to answer