diff --git a/JiraPS/Public/New-JiraIssue.ps1 b/JiraPS/Public/New-JiraIssue.ps1 index d2d83784..8d5477cf 100644 --- a/JiraPS/Public/New-JiraIssue.ps1 +++ b/JiraPS/Public/New-JiraIssue.ps1 @@ -45,6 +45,11 @@ function New-JiraIssue { [PSCustomObject] $Fields, + [Parameter( ValueFromPipelineByPropertyName )] + [AllowNull()] + [String[]] + $Components, + [Parameter()] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] @@ -107,6 +112,13 @@ function New-JiraIssue { } } + if ($Components) { + $requestBody["components"] = [System.Collections.ArrayList]@() + foreach ($item in $Components) { + $null = $requestBody["components"].Add( @{ id = "$item" } ) + } + } + if ($FixVersion) { $requestBody['fixVersions'] = [System.Collections.ArrayList]@() foreach ($item in $FixVersion) { diff --git a/docs/en-US/commands/New-JiraIssue.md b/docs/en-US/commands/New-JiraIssue.md index 775e880e..c8abf675 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] ] [[-Parent] ] + [[-Description] ] [[-Reporter] ] [[-Labels] ] [[-Components] ] [[-Parent] ] [[-FixVersion] ] [[-Fields] ] [[-Credential] ] [-WhatIf] [-Confirm] [] ``` @@ -274,6 +274,21 @@ Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -Components + +List of component ids which will be added to the issue. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` ### -WhatIf