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
in my case $_user is a string not a JiraPs.User. Inside Get-JiraUser an attempt is made to get the field
$_user.Name with no check on the type of $_user
In v2.4.4, Get-JiraUser checked the supplied user name was of type JiraPS.User
if ((Get-Member -InputObject $i).TypeName -eq 'JiraPS.User')
and if not, assumed calling .ToString() would yield the username
The text was updated successfully, but these errors were encountered:
stevenyoungs
changed the title
Remove-JIRAGroupMember fails
Remove-JiraGroupMember fails
Jul 6, 2018
lipkau
added a commit
to lipkau/JiraPS
that referenced
this issue
Jul 8, 2018
Description
Calling Remove-JiraGroupMember with valid strings for Group and User, where both group and user do exist, fails with
The exact line I'm using is as follows:
Remove-JiraGroupMember -Group "ValidGroupName" -User "ValidUserName" -Force -Credential $Credential
$Credential is a valid PSCredential
Steps To Reproduce
Run the following Powershell script where $Credential is a valid PSCredential for your JIRA server with admin rights.
Expected behavior
No error, and the user is removed from membership of the JIRA group
Your Environment
JiraPS 2.8.0
Windows 10
PSVersion 5.1
JIRA 7.5.0
Possible Solution
The problem may be inside Remove-JiraGroupMember where Get-JiraUser is called like so:
$userObj
= Get-JiraUser -InputObject $_user -Credential $Credential -ErrorAction Stopin my case $_user is a string not a JiraPs.User. Inside Get-JiraUser an attempt is made to get the field
$_user.Name with no check on the type of $_user
In v2.4.4, Get-JiraUser checked the supplied user name was of type JiraPS.User
if
((Get-Member -InputObject $i).TypeName -eq 'JiraPS.User')and if not, assumed calling .ToString() would yield the username
The text was updated successfully, but these errors were encountered: