execute JQL query programatically in JIRA 4.0.2

Donal Murtagh
Contributor
March 8, 2012

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
Answer accepted
Dieter
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 Leaders.
March 9, 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
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 Leaders.
March 9, 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/
Donal Murtagh
Contributor
March 11, 2012

Very helpful, thanks a lot

Suggest an answer

Log in or Sign up to answer