Search code examples
node.jsjirajqljira-rest-java-apijira-rest-api

Query JIRA API for all issues at "Awaiting Release"


I'm trying to use the JIRA REST API (2.0.alpha1), to query and get all issues in a certain project at "Awaiting Release".

I can get a query to get me all issues in a certain project "TST" (with this string):

http://hostname.com/jira/rest/api/2.0.alpha1/search?jql=project=TST

However, I want to filter this further by only getting the issues with a certain status.

I've created a filter in JIRA using their JQL language, and it looks like this (if this helps):

project = TST AND issuetype in (Bug, "User Story") AND status = "Awaiting Release"

Also, I am using 'node-jira' (https://npmjs.org/package/jira). If you are familiar, here is my call. It always returns a 500 for some reason.

 jira.searchJira('project=TST', {}, function (err, issue) {

      console.log(err);

      console.log(issue);
 });

Here is the documentation: https://docs.atlassian.com/jira/REST/latest/#d2e1291

Here is the example page: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues#JIRARESTAPIExample-Queryissues-Request.4


Solution

  • Okay, I've got the following URL query that works:

     http://hostname.com/jira/rest/api/2.0.alpha1/search?jql=project=TST+AND+status=%22Awaiting%20Release%22+AND+issuetype+in%20(Bug,%20%22User%20Story%22)
    

    However, I still cannot figure out why that node-jira is returning a 500 on the result. Please post if you have any input as well!