From 0a201610313d582d6effb2eb7082b2c21ae27a63 Mon Sep 17 00:00:00 2001 From: mirrorgleam Date: Fri, 26 Apr 2019 09:08:44 -0400 Subject: [PATCH] Added -Exact flag to Get-JiraUser 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. --- JiraPS/Public/Invoke-JiraIssueTransition.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JiraPS/Public/Invoke-JiraIssueTransition.ps1 b/JiraPS/Public/Invoke-JiraIssueTransition.ps1 index e9f96d70..43cfa0b0 100644 --- a/JiraPS/Public/Invoke-JiraIssueTransition.ps1 +++ b/JiraPS/Public/Invoke-JiraIssueTransition.ps1 @@ -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