Skip to content

Commit

Permalink
Added -Exact flag to Get-JiraUser
Browse files Browse the repository at this point in the history
If JIRA has usernames such as "jsmith", "jsmithy", "jsmith1", "jsmithson" and you are trying to assign the ticket to "jsmith" it will fail because the assignee field needs a string but this function is returning an array of strings.
By adding the Exact flag to the Get-JiraUser function this issue is resolved as only one user object is returned.
  • Loading branch information
mirrorgleam authored Apr 26, 2019
1 parent 947628c commit 0a20161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JiraPS/Public/Invoke-JiraIssueTransition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function Invoke-JiraIssueTransition {
$validAssignee = $true
}
else {
if ($assigneeObj = Get-JiraUser -InputObject $Assignee -Credential $Credential) {
if ($assigneeObj = Get-JiraUser -InputObject $Assignee -Credential $Credential -Exact) {
Write-Debug "[$($MyInvocation.MyCommand.Name)] User found (name=[$($assigneeObj.Name)],RestUrl=[$($assigneeObj.RestUrl)])"
$assigneeString = $assigneeObj.Name
$validAssignee = $true
Expand Down

0 comments on commit 0a20161

Please sign in to comment.