Skip to content

Commit

Permalink
Fixed method for adding labels to issue
Browse files Browse the repository at this point in the history
array was created with "null" as first entry,
if the issue didn't have labels before
  • Loading branch information
lipkau committed Jul 1, 2019
1 parent 2f2432d commit 5edd70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JiraPS/Public/Set-JiraIssueLabel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# Find the proper object for the Issue
$issueObj = Resolve-JiraIssueObject -InputObject $_issue -Credential $Credential

$labels = [System.Collections.ArrayList]@($issueObj.labels)
$labels = [System.Collections.ArrayList]@($issueObj.labels | Where-Object {$_})

# As of JIRA 6.4, the Add and Remove verbs in the REST API for
# updating issues do not support arrays of parameters - you
Expand Down Expand Up @@ -114,7 +114,7 @@
$parameter = @{
URI = $issueObj.RestURL
Method = "PUT"
Body = ConvertTo-Json -InputObject $requestBody -Depth 4
Body = ConvertTo-Json -InputObject $requestBody -Depth 6
Credential = $Credential
}
Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter"
Expand Down

0 comments on commit 5edd70a

Please sign in to comment.