Open tsimons-mlmic opened 1 year ago
Any update on this?
I am seeing the same thing - and it seems it's because it's using v2 of the API in the module?
How to replicate:
$cred = Get-Credential
PowerShell credential request
Enter your credentials.
User: email@domain.com
Password for user email@domain.com: ************************
Set-JiraConfigServer -Server "https://company.atlassian.net"
New-JiraSession -Credential $cred
Username WebSession
-------- ----------
email@domain.com Microsoft.PowerShell.Commands.WebRequestSession
get-jirauser -Name accountID -Credential $cred -Verbose
VERBOSE: [Get-JiraUser] Function started
VERBOSE: [Get-JiraConfigServer] Function started
VERBOSE: [Get-JiraConfigServer] Complete
VERBOSE: [Get-JiraUser] Processing [accountID]
VERBOSE: [Invoke-JiraMethod] Function started
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE:
Name Value
---- -----
username accountID
maxResults 50
VERBOSE: [Invoke-JiraMethod] Get https://company.atlassian.net/rest/api/2/user/search?username=accountID&maxResults=50
VERBOSE: [Invoke-JiraMethod] Failed to get an answer from the server
VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors
VERBOSE: [Invoke-JiraMethod] Status code: BadRequest
VERBOSE: [Resolve-ErrorWebResponse] Function started
VERBOSE: [Resolve-ErrorWebResponse] Retrieved body of HTTP response for more information about the error ($responseBody)
Invoke-JiraMethod: The query parameter 'username' is not supported in GDPR strict mode.
Invoke-JiraMethod:
VERBOSE: [Resolve-ErrorWebResponse] Function ended
VERBOSE: [Invoke-JiraMethod] Function ended
Get-JiraUser: No results when searching for user accountID
VERBOSE: [Get-JiraUser] Complete
get-module jiraps
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.14.6 JiraPS {Add-JiraFilterPermission, Add-JiraGroupMember, A…
PS C:\Users\tdpocv0> $psversiontable
Name Value
---- -----
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
There is an issue in lines 2736 and 2737 in the JiraPS.psm1 file in version 2.14.6 of the JiraPS PowerShell Module.
$searchResourceUri = "$server/rest/api/2/user/search?username={0}"
$exactResourceUri = "$server/rest/api/2/user?username={0}"
According to the Jira REST API documentation, the "username" query parameter is deprecated.
In this section of the documentation, they say you can use the query parameter named "query" to match against the displayName and emailAddress user attributes.
In my install of the JiraPS module, I have modified my JiraPS.psm1 file to use the query parameter, "query".
$searchResourceUri = "$server/rest/api/2/user/search?query={0}"
$exactResourceUri = "$server/rest/api/2/user?query={0}"
Description
While connected to our Jira Cloud instance, I'm unable to get-jirauser, it returns an error. Other commands, add-jiraissue, etc, have been verified as wworking
Steps To Reproduce
`PS C:\WINDOWS\system32> Get-Module JiraPS -ListAvailable | Select Name, Version VERBOSE: Populating RepositorySourceLocation property for module JiraPS. VERBOSE: Loading module from path 'C:\Users\\Documents\WindowsPowerShell\Modules\JiraPS\2.14.6\JiraPS.psm1'.
Name Version
JiraPS 2.14.6
PS C:\WINDOWS\system32> $PSVersionTable
Name Value
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\WINDOWS\system32> `