MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API
https://mrrefactoring.github.io/jira.js/
MIT License
366 stars 49 forks source link

Find Users for Picker does not exclude users #250

Closed rdohms closed 1 year ago

rdohms commented 1 year ago

I found an interesting bug that is both a JIRA issue and an issue in this library. I did not have the means to validate the internal code and how it gets there so I'm reporting this in the hopes that someone is quicker than me in doing that.

The "Find users for picker" endpoint has two options for excluding a given set of users:

I tested this directly on the API and found what I think explains why it does not work. The API states This parameter accepts a comma-separated list, but I found this to be false, when providing my sample as excludeAccountsIds=id1,id2 it returned both. However, when passing it as excludeAccountsIds=id1&excludeAccountsIds=id2 it worked as expected. With a single Id, both scenarios work as expected.

I believe internally jira.js is doing the first scenario, or something different (was unable to debug so far), and thus it's not getting the desired results, the property is defined as.string[] in the type files.

Can anyone shed more light on how to make it do what the API expects? Trying to report this to Jira as well. Using V3 of the API.

MrRefactoring commented 1 year ago

Hello @rdohms! Thank you for reporting, definitely, it's a jira.js bug. Let me fix this.

MrRefactoring commented 1 year ago

Was fixed in v2.16.1