< Back

Invoke-JiraIssueTransition

Thu Jan 16, 2020 8:03 am

NAME Invoke-JiraIssueTransition



SYNOPSIS

Performs an issue transition on a JIRA issue changing it's status





SYNTAX

Invoke-JiraIssueTransition [-Issue] <Object> [-Transition] <Object> [[-Fields] <PSCustomObject>] [[-Assignee]

<Object>] [[-Comment] <String>] [[-Credential] <PSCredential>] [-PassThru] [<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-Issue <Object>

The Issue Object or ID to transition.



Can be a `JiraPS.Issue` object, issue key, or internal issue ID.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-Transition <Object>

The Transition Object or it's ID.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Fields <PSCustomObject>

Any additional fields that should be updated.



Fields must be configured to appear on the transition screen to use this parameter.



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Assignee <Object>

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.



Required? false

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Comment <String>

Comment that should be added to JIRA.



Comment field must be configured to appear on the transition screen to use this parameter.



Required? false

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Credentials to use to connect to JIRA. If not specified, this function will use anonymous access.



Required? false

Position? 6

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Whether output should be provided after invoking this function.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

[JiraPS.Issue] / [String] / [JiraPS.Transition]







OUTPUTS

[JiraPS.Issue]

When `-Passthru` is provided, the issue will be returned.





NOTES





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.



-------------------------- EXAMPLE 1 --------------------------



Invoke-JiraIssueTransition -Issue TEST-01 -Transition 11



Invokes transition ID 11 on issue TEST-01.

-------------------------- EXAMPLE 2 --------------------------



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.

-------------------------- EXAMPLE 3 --------------------------



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.

-------------------------- EXAMPLE 4 --------------------------



$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.

-------------------------- EXAMPLE 5 --------------------------



$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.



RELATED LINKS

Online Version: https://atlassianps.org/docs/JiraPS/com ... ransition/

about_JiraPS_CustomFields

about_JiraPS_UpdatingIssues

Get-JiraIssue