Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 2.8.1


Section


Column
width600px


Panel
borderColor#333f48
bgColor#FFFFFF
titleColor#eeeeee
borderWidth1
titleBGColor#333f48
borderStylesolid
titleOn this page

Table of Contents
maxLevel1



Column




Features used to implement the examples

  • Boolean condition and validator with math. date-time or text-string terms
  • Virtual field Current date and time
  • Virtual field Date and time of latest status change(available from version 2.1.22): subtracting it to Current date and time gives us the time current issue has rested in current status.
  • Virtual field Current user and function isInRole(): used as backdoor for allowing transition being executed by certain roles, as Administrator.


Example 1: Prevent a closed issue from being reopened after resting 1 week closed

We want to prevent a certain issue from being reopened after 7 days closed, unless the user has the role of "Administrator" or "Supervisor".

We implement this use case by inserting a validator Boolean validator with math, date-time or text-string terms  in transition "Reopen Issue" with the following configuration:


Boolean expression used in the example is:

%{00016} = "Closed" AND {00057} - {00158} > 7 * {DAY} IMPLIES isInRole(%{00020}, "Administrator") OR isInRole(%{00020}, "Supervisor")

We are using logical connective IMPLIES for clarity. An equivalent expression using only primitive logical connectives is:

%{00016} != "Closed" OR {00057} - {00158} < 7 * {DAY} OR isInRole(%{00020}, "Administrator") OR isInRole(%{00020}, "Supervisor")

Note that:

  • %{00016} is field code for Issue status
  • {00057} is code for numerical value of field Current date and time
  • {00158} is code for numerical value of field Date and time of latest status change (available from version 2.1.22)
  • %{00020} is field code for Current user

Once configured, transition "Reopen Issue" looks like this



Example 2: Ensure that issues rest in certain status at least 24 hours

As in the previous example, we allow users in "Administrator" or "Supervisor" project role to bypass this time restriction.

We insert Boolean validator with math, date-time or text-string terms  in all the transitions with origin in the status we want to ensure 24 hours of permanence:


Boolean expression used in the example is:

{00057} - {00158} > 24 * {HOUR} IMPLIES isInRole(%{00020}, "Administrator") OR isInRole(%{00020}, "Supervisor")

An equivalent expression is:

{00057} - {00158} <= 24 * {HOUR} OR isInRole(%{00020}, "Administrator") OR isInRole(%{00020}, "Supervisor")


Example 3: Enroute issues to different statuses depending on the time they rested in current status

We have different transitions with origin in a certain status A, and with different destination statuses (B, C and D).

We use Boolean condition with math, date-time or text-string terms  in each of the 3 transitions A -> B, A -> C and A -> D with different boolean expressions, in order to show in UI only one of these transitions depending on the time the issue has passed in status A, while hiding the other two transitions:



Other examples of that function

Incoming Links
pageBoolean condition and validator with math. date-time or text-string terms
labelsexample



Related Usage Examples

Content by Label
showSpacefalse
cqllabel = "example" and label = "transition"