execute JQL query programatically in JIRA 4.0.2

I'm writing a Gadget packaged as a JIRA plugin. I need to execute a JQL query from the Gadget's JavaScript code and get the results. In JIRA 5.0 there a RESTful API that supports this, but I'm using JIRA 4.0.2.

There's a plugin named "JIRA REST Plugin" installed, which I presume supports this, but I can't find any documentation that explains how to use this to execute a JQL query

1 answer

1 accepted

1 vote
Dieter Community Champion Mar 09, 2012
Hi Donal, Afaik Jira supports a real Rest based Api only since 4.2. Please check these release notes regarding this: http://confluence.atlassian.com/display/JIRA/JIRA+4.2+Release+Notes So the plugin you mention is only the *framework* that lets one write rest module plugins. So only the *framework* was available since 4.0. Someone might have downported the rest api plugin which aims at providing the Jira api remotely using rest but for sure this was not in the 4.0.2 release. There is an alternate solution: with 4.0.2 you would have to download the XMLfile containing the search results and parse this XML in javascript. You can pass the JQL query in a parameter named jqlQuery. You get the URL when you click the view XML . here is an example of the URL that returns your reported issues as XML: https://jira.atlassian.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=reporter+%3D+currentUser(). of course you must logged in first
Dieter Community Champion Mar 09, 2012
Here is an example gadget that shows how to log on, download the search results as xml and parse the result xml: http://code.google.com/p/jira-gadgets/

Very helpful, thanks a lot

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

239 views 5 14
Read article

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