floralvikings / jira-connector

NodeJS Wrapper for the Jira REST API
http://floralvikings.github.io/jira-connector/
MIT License
373 stars 180 forks source link

Using Search 'fields' option returns undefined #2

Closed griojas closed 9 years ago

griojas commented 9 years ago

Whenever i call the search method and pass along jql and fileds, i get a undefined.

Here the call:

jira.search.search({jql: 'issuetype in(Story,Bug,Issue) AND status not in("Resolved","Closed") AND sprint in openSprints()', fields: 'summary,status' }, function(err, res) { console.log(res);});

Whenever i omit the 'fields' option, it works like a charm.

floralvikings commented 9 years ago

The fields parameter is actually an array, rather than a comma separated string; that's probably what's causing the issue.

Try using this, instead:

jira.search.search( {
    jql: 'issuetype in(Story,Bug,Issue) AND status not in("Resolved","Closed") AND sprint in openSprints()', 
    fields: ['summary', 'status']
  }, 
  function(err, res) { console.log(res); }
);
floralvikings commented 9 years ago

@griojas Did using an array instead of the comma separated string fix your problem?