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

BugFix issue #482 allowing Component ID in New-Issue #483

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
12 changes: 12 additions & 0 deletions JiraPS/Public/New-JiraIssue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ function New-JiraIssue {
[PSCustomObject]
$Fields,

[Parameter( ValueFromPipelineByPropertyName )]
[AllowNull()]
[String[]]
$Components,

[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
Expand Down Expand Up @@ -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) {
Expand Down
17 changes: 16 additions & 1 deletion 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[]>] [[-Parent] <String>]
[[-Description] <String>] [[-Reporter] <String>] [[-Labels] <String[]>] [[-Components] <String[]>] [[-Parent] <String>]
[[-FixVersion] <String[]>] [[-Fields] <PSCustomObject>] [[-Credential] <PSCredential>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand Down Expand Up @@ -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

Expand Down
Loading