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

This widget could not be displayed.
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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 7 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

13 views 0 0
Join discussion

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