Skip to content

Commit 273e22b

Browse files
michelelibermanMichele Liberman
and
Michele Liberman
authored
BugFix issue #482 allowing Component ID in New-Issue (#483)
Co-authored-by: Michele Liberman <mliberman@smartcommunications.com>
1 parent 4a64a1d commit 273e22b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

JiraPS/Public/New-JiraIssue.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ function New-JiraIssue {
4545
[PSCustomObject]
4646
$Fields,
4747

48+
[Parameter( ValueFromPipelineByPropertyName )]
49+
[AllowNull()]
50+
[String[]]
51+
$Components,
52+
4853
[Parameter()]
4954
[System.Management.Automation.PSCredential]
5055
[System.Management.Automation.Credential()]
@@ -107,6 +112,13 @@ function New-JiraIssue {
107112
}
108113
}
109114

115+
if ($Components) {
116+
$requestBody["components"] = [System.Collections.ArrayList]@()
117+
foreach ($item in $Components) {
118+
$null = $requestBody["components"].Add( @{ id = "$item" } )
119+
}
120+
}
121+
110122
if ($FixVersion) {
111123
$requestBody['fixVersions'] = [System.Collections.ArrayList]@()
112124
foreach ($item in $FixVersion) {

docs/en-US/commands/New-JiraIssue.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Creates a new issue in JIRA
1717

1818
```powershell
1919
New-JiraIssue [-Project] <String> [-IssueType] <String> [-Summary] <String> [[-Priority] <Int32>]
20-
[[-Description] <String>] [[-Reporter] <String>] [[-Labels] <String[]>] [[-Parent] <String>]
20+
[[-Description] <String>] [[-Reporter] <String>] [[-Labels] <String[]>] [[-Components] <String[]>] [[-Parent] <String>]
2121
[[-FixVersion] <String[]>] [[-Fields] <PSCustomObject>] [[-Credential] <PSCredential>] [-WhatIf] [-Confirm]
2222
[<CommonParameters>]
2323
```
@@ -274,6 +274,21 @@ Default value: None
274274
Accept pipeline input: False
275275
Accept wildcard characters: False
276276
```
277+
### -Components
278+
279+
List of component ids which will be added to the issue.
280+
281+
```yaml
282+
Type: String[]
283+
Parameter Sets: (All)
284+
Aliases:
285+
286+
Required: False
287+
Position: 12
288+
Default value: None
289+
Accept pipeline input: False
290+
Accept wildcard characters: False
291+
```
277292
278293
### -WhatIf
279294

0 commit comments

Comments
 (0)