Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 2

...

applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

...


Info
titleAvailability
  • This routine is available starting with SIL Engine™ 1.0.
  • This routine is available for Jira server and cloud deployment options.

Syntax

autotransition(transition, issueKey)

Tip
titleNew Parameter

Starting with SIL Engine™ 2.5.3, the "skipStateCheck" parameter was added that allows to force the target transition even if the issue is currently inside another transition and has been modified.

autotransition(transition, issueKey, skipStateCheck)

autotransition(transition, issueKey, skipStateCheck, skipConditions, skipValidators)

...

Package

...

Alias

...

autotransition(transition, issueKey),autotransition(transition, issueKey, skipStateCheck)

...

Pkg Usage

Description


Executes a transition and moves to the specified step.
Excerpt
hiddentrue
Tip

On the cloud version, you can only use: autotransition(transitionId, issueKey)


Description

Excerpt

Executes a transition and moves to the specified step. It will execute the transition only if the transition is valid for the current status of the issue.

If the skipStateCheck parameter is set to true, the routine will force the target transition even if the issue is currently inside another transition and has been modified.

...


Info
Table plus
false
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingtitleCreate Issue Transition

To use the routine on the Create Issue transition, it is very important that you place the SIL post function after the "Creates the issue originally" post function but before "Fire a Issue Created event that can be processed by the listeners.". Positioning the SIL™ post function otherwise will de-synchronize the issue from the workflow. That will set an invalid status for the workflow step it is in.


Parameters

Parameter name

Type

Required

Description

transition

...

string

Yes

...

Id or the name of the transition that will be executed.

Note

Only the id, for cloud development. The id must be a number.


issuekey

...

string

Yes

Key of the issue the transition will be executed for.

skipStateCheck

...

booleanNoIf set to "true", will force the target transition even if the issue is currently inside another transition and has been modified.
skipConditions

...

booleanNoIf set to true, will not check conditions on the target transition
skipValidators

...

booleanNoIf set to true, will not check validators on the target transition

Return

...

type

Boolean boolean (true/false)

If the return value is "true", the transition was executed successfully. A "false" return value means that the transition failed. In this case check the log for additional details.

Note

Starting with version 2.5.3, autotransitions are executed after the script has finished.

...

Since we do not know the result of the operation at the time the routine is called inside the script, it will return "true" by default.


Example

Example 1

language
Code Block
js
autotransition(121, "PRJ-123");

Returns "true" if the transition with the ID=121 for the issue PRJ-123 was executed and "false" if  if the transition wasn't executed.

Note

Starting with version 2.5.3 will always return "true".


Example 2

Code Block
languagejs
autotransition("Require information", "PRJ-232");

Returns Returns "true" if the transition requirng information for the issue PRJ-232 was executed and "false" if the transition wasn't executed.

Note

Starting with version 2.5.3 will always return "true".

Notes

Note
  1. If the transition requires a screen it will not be displayed for additional input.
  2. You should do all issue modifications in or before the post function that contains the calling of the auto transition.
  3. All post functions executed by the called transitions should not modify the issue. These post functions could be used for sending notifications.
  4. If there are validations and/or conditions in the transition called after the one that contains the auto transition, and these validations fail, the transition will not be executed.

Frequent Problems

Problem: When executing an autotransition, it fails with the message: It seems that you have tried to perform a workflow operation (<Transition_Name>) that is not valid for the current state of this issue (<Issue_Key>). The likely cause is that somebody has changed the issue recently, please look at the issue history for details.

Solution: Set the skipStateCheck parameter to "true".

See also

Filter by label (Content by label)
showLabelsfalsemax25
showSpacefalse
cqllabel = "workflow_routine" and space = currentSpace ( )
labelsarrayworkflow_routinesroutine