Performs an issue transition on a JIRA issue changing it’s status
Invoke-JiraIssueTransition [-Issue] <Object> [-Transition] <Object> [[-Fields] <PSCustomObject>]
[[-Assignee] <Object>] [[-Comment] <String>] [[-Credential] <PSCredential>] [-Passthru] [<CommonParameters>]
This function performs an issue transition on a JIRA issue.
Transitions are defined in JIRA through workflows, and allow the issue to move from one status to the next.
For example, the “Start Progress” transition typically moves an issue from an Open status to an “In Progress” status.
To identify the transitions that an issue can perform,
use Get-JiraIssue
and check the Transition property of the issue obj ect returned.
Attempting to perform a transition that does not apply to the issue
(for example, trying to “start progress” on an issue in progress) will result in an exception.
Invoke-JiraIssueTransition -Issue TEST-01 -Transition 11
Invokes transition ID 11 on issue TEST-01.
Invoke-JiraIssueTransition -Issue TEST-01 -Transition 11 -Comment 'Transition comment'
Invokes transition ID 11 on issue TEST-01 with a comment. Requires the comment field to be configured visible for transition.
Invoke-JiraIssueTransition -Issue TEST-01 -Transition 11 -Assignee 'joe.bloggs'
Invokes transition ID 11 on issue TEST-01 and assigns to user ‘Joe Blogs’.
Requires the assignee field to be configured as visible for transition.
$transitionFields = @{'customfield_12345' = 'example'}
Invoke-JiraIssueTransition -Issue TEST-01 -Transition 11 -Fields $transitionFields
Invokes transition ID 11 on issue TEST-01 and configures a custom field value.
Requires fields to be configured as visible for transition.
$transition = Get-JiraIssue -Issue TEST-01 | Select-Object -ExpandProperty Transition | ? {$_.ResultStatus.Name -eq 'In Progress'}
Invoke-JiraIssueTransition -Issue TEST-01 -Transition $transition
This example identifies the correct transition based on the result status of “In Progress” and invokes that transition on issue TEST-01.
The Issue Object or ID to transition.
Can be a JiraPS.Issue
object, issue key, or internal issue ID.
Type: Object
Parameter Sets: (All)
Aliases: Key
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
The Transition Object or it’s ID.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Any additional fields that should be updated.
Fields must be configured to appear on the transition screen to use this parameter.
Type: PSCustomObject
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
New assignee of the issue.
Enter Unassigned
to remove the assignee of the issue.
Assignee field must be configured to appear on the transition screen to use this parameter.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Comment that should be added to JIRA.
Comment field must be configured to appear on the transition screen to use this parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
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: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Whether output should be provided after invoking this function.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
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).
When -Passthru
is provided, the issue will be returned.
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.