jira-node / node-jira-client

A Node.js wrapper for the Jira REST API
https://jira-node.github.io/
MIT License
450 stars 169 forks source link

Get Filter not Working #320

Open nrfribeiro opened 3 years ago

nrfribeiro commented 3 years ago

Hi, I try to use getfilter and is not working. Looking into the code I notice that makeAgileUri call should be makeUri instead

getFilter(filterId) { return this.doRequest(this.makeRequestHeader(this.makeAgileUri({ pathname: /filter/${filterId}, }))); }

MikeSperone commented 3 years ago

Just ran into this myself. ~It looks like it's making a request with the 1.0 API version, even though I have v. 2 specified in my config.~
(edit: nm, just looked through the code, and I guess it's just a different endpoint)

~I've noticed no PR's have been merged in a couple of years. Is there a maintainer of this project who would be able to comment on this? Is there someone who would be able to review and merge a PR for this?~ (edit2: oops, I see this isn't true. Sorry... I should've look around more before commenting)

MikeSperone commented 3 years ago

I was able to do this workaround, since the internal functions are available:

const JiraApi = require('jira-client');
const jira = new JiraApi({
   /* config parameters */
});

function getJiraFilter(filterId) {
    return jira.doRequest(jira.makeRequestHeader(jira.makeUri({
        pathname: `/filter/${filterId}`,
    })));
}

Sorry I'm unable to go ahead and do a pull request, but hopefully this will save time for anyone who is stuck!