Page tree

Versions Compared

Key

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

Excerpt

Table of Contents
maxLevel2
minLevel2
absoluteUrltrue
stylesquare

Introduction

So, you've already

know

known what the templates are. How about getting deeper? Let

's

us show you the real power of our plugin. Let's start with

conditions

condition templates. What are the conditions in the first place?

Conditions 

Conditions control whether a transition should be executed

, they

. They operate before the action will actually happen - preventing or allowing the execution.

Adding conditions to the workflow is a challenge

in

itself, not to mention how time-consuming it is. Especially when you have hundreds of transitions and complex workflows. Some of these conditions remain basically

remain

the same and yet they have to be entered. And this is

were

where Workflow PowerBox comes in handy giving you

a

the possibility to gather all parameters in one place, save it as a template and then re-use it wherever you want!


Panel
borderColor#5db037
titleColorwhite
borderWidth1
titleBGColor#5db037
titleContents:


Excerpt

Table of Contents
maxLevel2
minLevel2
indent25px
absoluteUrltrue
stylesquare




Creating a new template

Templates are useful

,

as they make your work easier and faster. But how to use them? Let's create

you

your very first condition template!

Note
To start with, you have to have
JIRA
the Jira Administrators global permission

Creating a template is possible for any user that

have JIRA

has the Jira Administrators' permission.

Administrative

The administration panel where you can create a template is located in the Workflows Section.

Tip
Use 
Use a Keyboard shortcutg + g + start typing condition templates


 

Now , you will be redirected to the Condition Templates page , where you have all condition templates listed in one place. Note that they are grouped in into two categories: Active and Inactive. In order to add a new template click click the Add Template button.  Dialog The dialogue displays the Template's Name and Description fields (both fields can be changed later on).

Fill in the fields and confirm with with the Add button. Your template is now created!


Panel
borderColor
 
red
 
titleColor
 
white
 
titleBGColor
 
red
 
title

 

 

 

 

 

 

 

 

 

 

  

 

Adding Conditions to Condition
Inactive Template

Shortly after creating a new template you will notice it on the list of existing templates. By default, it will get an inactive status. That's because it is not associated with any transition in any active workflow. 


Panel
borderColorgreen
titleColorwhite
titleBGColorgreen
titleActive Template

As soon as you associate your template with a workflow's transition it will become active. Note that any changes made on an active template will require a publishing draft.



Adding Conditions to a Template

Creating a template is just a the beginning. The next and the most important step is to adjust it to your needs. You can define your template by adding desired conditions. You can construct complex conditions by grouping and nesting them. This  It allows you to create dependencies that will help you in your work. Moreover, you can toggle the logic for how the conditions in a group are applied between All and Any as shown below.


  

You can always make any proper changes in the same panel by clicking Edit a condition template. When you are editing an active template you edit as a matter of fact are actually editing a draft. Please remember to publish this draft after making any changes.

How to construct conditions?

You can smoothly manage newly created conditions. Next to each of them, you will find a panel with four buttons that allow you to fire a particular action. 


 set condition to: must fail/pass

 add grouped condition

 edit

 delete


Executing a template

Executing a template means nothing more than adding a template to the chosen transition in a workflow. As soon as you will have all workflows listed you have to select one of them and click click the Edit button in the Operations section. You will be redirected to the Edit Worklow Workflow page where you can see all the transitions that take place as shown below:

Click the desired transition and than then choose which of the worfklow workflow elements you want to extend (conditions, validator, validators or post functions) with a predefined template/.
From the list of conditions choose the Run Condition Templates option. Choose desired earlier created pre-defined template a previously created predefined template you want and add those parameters to your condition.

Your template will be added to the list of conditions that will be run for this particular transition.

Remember to publish the draft of a workflow so your changes will be considered.

Note
From now on your template will change its status from inactive to active. You can also check which workflows are associated with this template



Disabling a template

You can disable your template at any time.

  1. Log in as a user with the JIRA Jira Administrators global permission.
    Choose   > Issues. Select Workflows > Condition Templates  to to open the Condition Templates page.
    (info) Tip: Use Use a Keyboard shortcutg + g + start typing condition templates
  2. Choose the desired template and select the View or Edit button. You will be redirected to the Template Page
  3. Click Click the disable button. From this time now on your template will be disabled in all associated workflows. Remember that disabling/enabling template doesn't require publishing, so you can disable a template without publishing it.
  4. Note that a disabled template doesn't allow you to check any underlying condition. You can still control what happens if an a user try tries to execute a transition with a disabled template.
  5. You can enable your template at any time by clicking the Enable button.

Conditions template options

Conditions A conditions template has several options that can be configured.

You can configure plugin options for each type of templates template separately. Condition templates options are as listed below.

OptionPossible valueDescription
Template is disabledPass condition
Disabled
A disabled template works as the "always true" condition
,
without checking the template content.
Template

The template has been disabled by an administrator, and no condition check against the template will be performed

Fail condition
Disabled
A disabled template works as the "always false" condition, without checking the template content
 
.

Throw exception
Error
An error is raised and logged to a standard
JIRA
Jira log file.
Workflow
The workflow transition cannot be executed.
Template
A template is not foundPass condition
Invalid
An invalid or deleted template works as an "always true" condition.
Template
A template was deleted or cannot be found for any other reasonFail condition
Invalid
An invalid or deleted template works as an "always false" condition.
 

Throw exception
Error
An error is raised and logged to a standard
JIRA
Jira log file.
Workflow
The workflow transition cannot be executed.
Template is emptyPass condition
Empty
An empty template works as the "always true" condition.
Template
The template contains no conditionsFail condition
Empty
An empty template works as the "always false" condition.
 

Throw exception
Error
An error is raised and logged to a standard
JIRA
Jira log file.
Workflow
The workflow transition cannot be executed.
Condition checkingOptimized condition checkConditions are checked until it's clear that the transition can/cannot be executed and then the remaining conditions are omitted.
Method of condition checkingFull condition checkAll conditions in a template are checked regardless of the template logic.


Importing templates

  1. Log in as a user with the JIRA Jira Administrators global permission.
    Choose   > Issues. Select Workflows > Condition Templates  to to open the Condition Templates page.
    (info) Tip: Use Use a Keyboard shortcutg + g + start typing condition templates
  2. Click the Import button.
  3. Choose the XML file you want to upload and than then accept your choice with the Import button.

Exporting templates

Already created templates can be exported at any time to the XML file to your drive. In order to do so:

 

  1. Log in as a user with the JIRA Jira Administrators global permission.
    Choose   > Issues. Select Workflows > Condition Templates  to to open the Condition Templates page.
    (info) Tip: Use Use a Keyboard shortcutg + g + start typing condition templates
  2. Select the template that you want to be exported export and click Edit in the Operations section
  3. As soon as you choose choose the Export button, your template will be downloaded.

Inversing a condition result

Templates allow you to "inverse" a condition result. It causes that As a result, any failed condition will be is treated as passed and vice versathe other way round. This option is especially particularly useful when you look for a way to run such "except-type" conditions like as "Everybody except issue reporter can execute a transition".

To inverse, a condition result add the condition to a template and then click the  inversion button located in the action bar.

Image Modified
Inversion
The inversion indicator is displayed next to the condition's name. You can easily find all inversed conditions when editing a template.

When a condition is inversed you can see it as shown below: