From ccc864ebfb9cb445a508b0262081177e8368a18a Mon Sep 17 00:00:00 2001 From: hmmwhatsthisdo <2093321+hmmwhatsthisdo@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:44:36 -0700 Subject: [PATCH 1/4] Add `-Labels` --> `-Label` alias to `Set-JiraIssue` --- JiraPS/Public/Set-JiraIssue.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/JiraPS/Public/Set-JiraIssue.ps1 b/JiraPS/Public/Set-JiraIssue.ps1 index bd6f4b93..5ab0fb47 100644 --- a/JiraPS/Public/Set-JiraIssue.ps1 +++ b/JiraPS/Public/Set-JiraIssue.ps1 @@ -41,6 +41,7 @@ function Set-JiraIssue { [Object] $Assignee, + [Alias("Labels")] [String[]] $Label, From ec883403a2cd4496c9acb7640404afe5c05497a4 Mon Sep 17 00:00:00 2001 From: hmmwhatsthisdo <2093321+hmmwhatsthisdo@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:45:09 -0700 Subject: [PATCH 2/4] Rename+alias `-Labels` to `-Label` in `New-JiraIssue` --- JiraPS/Public/New-JiraIssue.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/JiraPS/Public/New-JiraIssue.ps1 b/JiraPS/Public/New-JiraIssue.ps1 index 6e42b581..3facaa68 100644 --- a/JiraPS/Public/New-JiraIssue.ps1 +++ b/JiraPS/Public/New-JiraIssue.ps1 @@ -29,8 +29,9 @@ function New-JiraIssue { $Reporter, [Parameter( ValueFromPipelineByPropertyName )] + [Alias("Labels")] [String[]] - $Labels, + $Label, [Parameter( ValueFromPipelineByPropertyName )] [String] @@ -105,9 +106,9 @@ function New-JiraIssue { $requestBody["parent"] = @{"key" = $Parent} } - if ($Labels) { + if ($Label) { $requestBody["labels"] = [System.Collections.ArrayList]@() - foreach ($item in $Labels) { + foreach ($item in $Label) { $null = $requestBody["labels"].Add($item) } } From 9b8c29b4254c15306c64e6346bc03c745ad5ade5 Mon Sep 17 00:00:00 2001 From: hmmwhatsthisdo <2093321+hmmwhatsthisdo@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:45:15 -0700 Subject: [PATCH 3/4] Update docs --- docs/en-US/commands/New-JiraIssue.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en-US/commands/New-JiraIssue.md b/docs/en-US/commands/New-JiraIssue.md index c8abf675..6cbab25f 100644 --- a/docs/en-US/commands/New-JiraIssue.md +++ b/docs/en-US/commands/New-JiraIssue.md @@ -17,7 +17,7 @@ Creates a new issue in JIRA ```powershell New-JiraIssue [-Project] [-IssueType] [-Summary] [[-Priority] ] - [[-Description] ] [[-Reporter] ] [[-Labels] ] [[-Components] ] [[-Parent] ] + [[-Description] ] [[-Reporter] ] [[-Label] ] [[-Components] ] [[-Parent] ] [[-FixVersion] ] [[-Fields] ] [[-Credential] ] [-WhatIf] [-Confirm] [] ``` @@ -192,7 +192,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Labels +### -Label List of labels which will be added to the issue. From 31471333bfcd79049fcb12387a994483e75ec4b1 Mon Sep 17 00:00:00 2001 From: hmmwhatsthisdo Date: Wed, 25 Sep 2024 05:40:35 -0700 Subject: [PATCH 4/4] Update unit tests --- Tests/Functions/New-JiraIssue.Unit.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 b/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 index 3b580c79..780d0349 100644 --- a/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 +++ b/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 @@ -134,7 +134,7 @@ Describe "New-JiraIssue" -Tag 'Unit' { defParam $command 'Summary' defParam $command 'Description' defParam $command 'Reporter' - defParam $command 'Labels' + defParam $command 'Label' defParam $command 'Fields' defParam $command 'Credential' }