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

Accepted Answer
1 vote
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
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

132 views 6 8
View post

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