Open Growlert opened 4 years ago
It looks like Jira have been in the process of depreciating the "username" string on their API to order to comply with European General Data Protection Regulation (GDPR)
It's been replaced by the "query" string.
We resolved this by altering the JiraPS module's Get-JiraUser function from:
$searchResourceUri = "$server/rest/api/2/user/search?username={0}"
$exactResourceUri = "$server/rest/api/2/user?username={0}"
to:
$searchResourceUri = "$server/rest/api/2/user/search?query={0}"
$exactResourceUri = "$server/rest/api/2/user?query={0}"
Hello @friendlyneighbourhoodcoder
is the query
query parameter valid for cloud server and on premise servers?
Hi @lipkau
Our organisation uses cloud server, so I can only confirm for cloud.
The problem with user references when calling against Jira Cloud is that Jira Cloud forces GDPR mode and all API calls that reference a user account have to use an ID, not a name any more.
I propose adding an optional flag to Set-JiraConfigServer
such as -GdprMode
or something to that effect which will alter the behavior of all other methods so that anywhere that a user is referenced, instead of referring by name, the reference will be changed to ID.
And then of course all those areas across the module need to be updated to support this, which can be eased by centralizing that logic into a method such as Resolve-JiraUserReference
. If this approach is palatable to everyone, then I will try to work on and submit a PR to that effect.
@ebekker - Sure thing, sounds like a plan!
Is there a way to get the user list with ids?
Is there a way to get the user list with ids?
According to the command based help, you can get all Jira users by
Get-JiraUser -UserName ""
The empty string "" matches all users.
or use the REST API
<server>/rest/api/2/user/search?username=
So, this is still an issue with the specific cmdlet Get-JiraUser 2.14.6
Get-Module JiraPS
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 2.14.6 JiraPS
This method does not work
Get-JiraUser -UserName ""
Invoke-JiraMethod: The username or property query parameter must be provided
Invoke-JiraMethod:
Get-JiraUser: No results when searching for user
Specifying my email address also does not work
Get-JiraUser -Username 'jeffrey.patton2@rackspace.com'
Invoke-JiraMethod: The query parameter 'username' is not supported in GDPR strict mode.
Invoke-JiraMethod:
Get-JiraUser: No results when searching for user jeffrey.patton2@###
You will need to update the function Get-JiraUser to accept AccountId, if that's what it's supposed to be, per some 2yr discussion in this STILL OPEN TICKET. Or deprectate this cmdlet and update the documentation to reflect the correct way to grab one or more users from Jira.
Description
When I try to get user information from command like:
Get-JiraUser -UserName 'some_user'
It thows me the error:Steps To Reproduce
Must use powershell module "JiraPS"
Expected behavior
Should output the username information
Screenshots
Your Environment
Possible Solution