You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Set-JiraUser cmdlet with the -Property parameter to set properties not named in the cmdlet (e.g. updating the user's login name), the command fails with the following output:
Invoke-JiraMethod : No value found to be changed.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.14.7\JiraPS.psm1:5876 char:27
+ $result = Invoke-JiraMethod @parameter
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
+ FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-JiraMethod
Steps To Reproduce
Connect to Jira server using Set-JiraConfigServer and New-JiraSession as per normal
Username for user bsmith should be changed to csmith
Workaround
In the same environment, crafting the REST body manually and calling Invoke-JiraMethod with the correct Uri per the below example produces the expected behavior:
$putUri="https://jira.contoso.com/rest/api/2/user?username=bsmith"$putBody="{""name"": ""csmith""}"Invoke-JiraMethod-URI $putUri-Body $changeBody-Method Put
(Note: URL of Jira server has been changed for privacy)
Your Environment
Jira Server Version: 9.12.2
Name Version
-----------
JiraPS 2.14.7
PSVersion
PSEdition
PSCompatibleVersions
BuildVersion
CLRVersion
WSManStackVersion
PSRemotingProtocolVersion
SerializationVersion
The text was updated successfully, but these errors were encountered:
Update: this appears to actually be a documentation issue. I realized after revisiting my workaround that passing @{Name="csmith"} in the -Property parameter will fail but @{name="csmith"} succeeds. It appears the user property names passed to the API are case sensitive (which is not specified in the official REST API docs) and do not match the capitalization used in the JiraPS outout objects or the example code given in the JiraPS documentation.
Description
When using the
Set-JiraUser
cmdlet with the-Property
parameter to set properties not named in the cmdlet (e.g. updating the user's login name), the command fails with the following output:Steps To Reproduce
Set-JiraConfigServer
andNew-JiraSession
as per normalExpected behavior
Username for user bsmith should be changed to csmith
Workaround
In the same environment, crafting the REST body manually and calling
Invoke-JiraMethod
with the correct Uri per the below example produces the expected behavior:(Note: URL of Jira server has been changed for privacy)
Your Environment
Jira Server Version: 9.12.2
The text was updated successfully, but these errors were encountered: