MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API

Home Page:https://mrrefactoring.github.io/jira.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Find Users for Picker does not exclude users

rdohms opened this issue · comments

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:

  • exclude: which is now deprecated
  • excludeAccountsIds: which is not working for multiple accounts

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.

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

Was fixed in v2.16.1