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

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
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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

29 views 0 10
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