Creates a new issue in JIRA
New-JiraIssue [-Project] <String> [-IssueType] <String> [-Summary] <String> [[-Priority] <Int32>]
[[-Description] <String>] [[-Reporter] <String>] [[-Labels] <String[]>] [[-Parent] <String>]
[[-FixVersion] <String[]>] [[-Fields] <PSCustomObject>] [[-Credential] <PSCredential>] [-WhatIf] [-Confirm]
[<CommonParameters>]
This function creates a new issue in JIRA.
Creating an issue requires a lot of data, and the exact data may be different from one instance of JIRA to the next.
To identify what data is required for a given issue type and project,
use the Get-JiraIssueCreateMetadata
function provided in this module.
Some JIRA instances may require additional custom fields specific to that instance of JIRA. In addition to the parameterized fields provided in this function, the Fields parameter accepts a hashtable of field names/IDs and values. This allows users to provide custom field data when creating an issue. Read more about it in about_JiraPS_CustomFields
New-JiraIssue -Project "TEST" -Type "Bug" -Summary "Test issue"
Creates a new issue in the TEST project.
This is the simplest way possible to use the command, given the project only requires these fields as mandatory.
Get-JiraIssueCreateMetadata -Project TEST -IssueType Bug | ? {$_.Required -eq $true}
New-JiraIssue -Project TEST -IssueType Bug -Priority 1 -Summary 'Test issue from PowerShell' -Description 'This is a test issue created from the JiraPS module in PowerShell.' -Fields @{'Custom Field Name 1'=@{"foo" = "bar"};'customfield_10001'=@('baz');}
This example uses Get-JiraIssueCreateMetadata
to identify fields required to create an issue in JIRA.
It then creates an issue with the Fields parameter providing a field name and a field ID.
$parameters = @{
Project = "TEST"
IssueType = "Bug"
Priority = 1
Summary = 'Test issue from PowerShell'
Description = 'This is a test issue created from the JiraPS module in PowerShell.'
Fields = @{
"Custom Field Name 1" = @{"foo" = "bar"}
customfield_10001 = @('baz')
}
}
New-JiraIssue @parameters
This illustrates how to use splatting for the example above.
Read more about splatting: about_Splatting
"project,summary,assignee,IssueType,Priority,Description" > "./data.csv"
"CS,Some Title 1,admin,Minor,1,Some Description 1" >> "./data.csv"
"CS,Some Title 2,admin,Minor,1,Some Description 2" >> "./data.csv"
import-csv "./data.csv" | New-JiraIssue
This example illuetrates how to prepare multiple new stories and pipe them to be created all at once.
Project in which to create the issue.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type of the issue.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Summary of the issue.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
ID of the Priority the issue shall have.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
Long description of the issue.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
User that shall be registered as the reporter.
If left empty, the currently authenticated user will be used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
List of labels which will be added to the issue.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Parent issue - in case of issues of type “Sub-Tasks”.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Set the FixVersion of the issue.
Type: String[]
Parameter Sets: (All)
Aliases: FixVersions
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Any additional fields.
See: about_JiraPS_CustomFields
Type: PSCustomObject
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Credentials to use to connect to JIRA.
If not specified, this function will use anonymous access.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This function requires either the -Credential
parameter to be passed or a persistent JIRA session.
See New-JiraSession
for more details.
If neither are supplied, this function will run with anonymous access to JIRA.