node-jira-client icon indicating copy to clipboard operation
node-jira-client copied to clipboard

Get Filter not Working

Open nrfribeiro opened this issue 3 years ago • 2 comments

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}, }))); }

nrfribeiro avatar Apr 25 '21 17:04 nrfribeiro

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 avatar Aug 20 '21 16:08 MikeSperone

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!

MikeSperone avatar Aug 20 '21 20:08 MikeSperone