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

0 votes
AmandaA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 18, 2013

Hey Kevin,

As in this post, we can see one of the plugin vendor comment that "Custom JavaScript in field configuration descriptions do still work in JIRA 5.2.4. They are hard to maintain though so plugin such as JSS or Script Runner may be a better way to go."

So in the meanwhile when you looking for the proper soulution for the scipt, maybe you can have a try on the CustomWare Traffic Lights plugin which can be download and viewd from here:

https://marketplace.atlassian.com/plugins/net.customware.jira.plugin.trafficlight

This plugin allow you add colors to existing fields.

Hope this is helpful somehow, Kevin.

Cheers,

Amanda

Suggest an answer

Log in or Sign up to answer