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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted

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
Community showcase
Published in Training & Certification

Introducing Atlassian University Live!

Atlassian University is committed to providing the best training and certification for Atlassian products through on-demand classes, in-person team training, a world-class certification program, and ...

295 views 8 16
Read article

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