“Either ‘usernames’ or ‘keys’ or ‘accountIDs’ need to be provided”

I’m trying to do :

const users = await asociateUsers.join("&");

*//accountId=5f58d00cdf83ab007d7&accountId=5f58d00cdf83ab007d7*

const result = await api
.asApp()
.requestJira(route`/rest/api/3/user/bulk?${users}`, {
headers: {
Accept: "application/json",
},
});

But i get this error

{
"errorMessages": [
"Either 'usernames' or 'keys' or 'accountIDs' need to be provided"
],
"errors": {}
}

Apparentlly “=” and “&” characters and uri encoded i think that’s the issue
How to fix it please

If you want to use route you have to pass the parameters separately, if you instead want to create your URL manually, you can use assumeTrustedRoute instead.

.requestJira(assumeTrustedRoute`/rest/api/3/user/bulk?${users}`

Should work in your case

1 Like

Works like a charm
Thank you !