Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Clicking a transition will show the transition triggers, conditions, validators, and postfunctionspost functions.


Keep in mind that:

1. Whenever an issue advances from one state to another the postfunctions post functions are called.

2. The transition is made possible only if the conditions are fulfilled. Therefore, a condition must return "true" or "false" to signal whether the condition is met or not.

...

An important consequence of the above model is that conditions and validators should not have side-effects. In fact, Power Scripts for Jira is discarding modifications of the issues, allowing them to occur in the postfunction post function only, but it cannot discard modifications made on another database, for instance, applied using the sql routine (see sql() routine for details).

To create conditions, validators and postfunctionspost functions, click the corresponding Add link at the top of the workflow management tab.

...

After you click the Add button, you can write or reuse your SIL (in this case, a SIL postfunctionpost function) by going through the wizard steps below.

...

Warning
titleModifying Issues

You should avoid modifying issues in conditions and validators, as they are supposed to be read-only. Do not yield to that temptation! You should modify issue values (or create new issues, or change anything) in the postfunction post function only. In fact, SIL runs executes the validators and conditions in read-only mode, discarding changes.

...

Returns codes are different for validators, conditions and postfunctionspost functions.

For validator:

Code Block
return false, "assignee", "We have failed, assignee is not ok";

...

Just tell Jira this condition is not fullfiled.

For postfunctionspost functions:

Code Block
return;

return ends the program, any values are ignored.

Note
titleNote

When writing postfunctionspost functions, conditions or validators for the Create issue transition, ensure that the SIL program is the last step of the transition. This is necessary because we need Jira to create the actual issue and save it to the database using the input parameters before we can access it.

...

Note
titleNote

In general, it's a good idea to place your postfunctions post functions after all standard postfunctionspost functions.



Workflow View

This view will help you browse through your workflow without having to open the program every time to see what it does.

...