Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify Label parameter names to singular form in New-/Set-JiraIssue #522

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions JiraPS/Public/New-JiraIssue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ function New-JiraIssue {
$Reporter,

[Parameter( ValueFromPipelineByPropertyName )]
[Alias("Labels")]
[String[]]
$Labels,
$Label,

[Parameter( ValueFromPipelineByPropertyName )]
[String]
Expand Down Expand Up @@ -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)
}
}
Expand Down
1 change: 1 addition & 0 deletions JiraPS/Public/Set-JiraIssue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function Set-JiraIssue {
[Object]
$Assignee,

[Alias("Labels")]
[String[]]
$Label,

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functions/New-JiraIssue.Unit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/commands/New-JiraIssue.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Creates a new issue in JIRA

```powershell
New-JiraIssue [-Project] <String> [-IssueType] <String> [-Summary] <String> [[-Priority] <Int32>]
[[-Description] <String>] [[-Reporter] <String>] [[-Labels] <String[]>] [[-Components] <String[]>] [[-Parent] <String>]
[[-Description] <String>] [[-Reporter] <String>] [[-Label] <String[]>] [[-Components] <String[]>] [[-Parent] <String>]
[[-FixVersion] <String[]>] [[-Fields] <PSCustomObject>] [[-Credential] <PSCredential>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand Down Expand Up @@ -192,7 +192,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Labels
### -Label

List of labels which will be added to the issue.

Expand Down
Loading