It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Query JIRA using Java API

Mohamed Suhail Jul 19, 2016

Hi,

Brief Background: I am working on developing a custom plugin that would collect statistical data about a projects or projects (depending on the administrative account login) and provide a detailed report with charts highlighting this information.

 

Curiosity: Looking at the material available online I noticed a lot of emphasis towards the use of JIRA REST API, this is great and interesting of course, and I have used this previously. I would like to know whether it is possible with the JIRA-API maven dependency (Java API) to query the projects for statistical information very similar to the REST API. For example, is there a service class I could use to query the number of all the issues created for a given project, or, count the number of issues created or resolved by a particular user or date,very similar to SQL querying. 
 

Any material available on this would be highly appreciate. 

Thank you & Regards,

Suhail

1 answer

1 accepted

3 votes
Answer accepted
Volodymyr Krupach Jul 19, 2016

Hi Mohamed,

I do it like:

String query = "project = DEMO";
Query conditionQuery = jqlQueryParser.parseQuery(query);
SearchResults results = searchService.search(jiraAuthenticationContext.getUser(), query, PagerFilter.getUnlimitedFilter());

If it's your first JIRA addon you need to study docs: https://developer.atlassian.com/jiradev/jira-platform/building-jira-add-ons/jira-plugins2-overview. Also make sure to check atlassian-scanner https://bitbucket.org/atlassian/atlassian-spring-scanner since it't the place where all newcomers stuck.

Have you got more examples? I can't find any on the official documentation... nor even Google is helping me... thanks.

Like Deviaphan likes this

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Off-topic

Disney Live Action Reboots: Are you for or against?

Happy Friday Everyone! Today marks the international release of Disney's live action version of the animated classic Aladdin. I know that this movie was met with some controversy of over cast...

198 views 21 10
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you