Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

So, you've already know what templates are. How about getting deeper? Let's show you the real power of our plugin. Let's start with conditions templates. What are conditions in the first place? Conditions control whether a transition should be executed, 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 basically remain the same and yet they have to be entered. And this is were Workflow PowerBox comes in handy giving you a possibility to gather all parameters in one place, save it as a template and then re-use it wherever you want!

Creating new template

Templates are useful, they make your work easier and faster. But how to use them? Let's create you very first condition template!

To start with, you have to have JIRA Administrators global permission

Creating a template is possible for any user that have JIRA Administrators permission. Administrative panel where you can create a template is located in the Workflows Section.

Use 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 two categories: Active and Inactive. In order to add a new template click the Add Template button. Dialog displays the Template's Name and Description fields (both fields can be changed later on).

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

Adding Conditions to Condition Template

Creating a template is just a 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 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 active template you edit as a matter of fact 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 Edit button in Operations section. You will be redirected to Edit Worklow page where you can see all the transitions that take place as shown below:

Click desired transition and than choose which of the worfklow elements you want to extend (conditions, validator, post functions) with a predefined template/
From the list of conditions choose Run Condition Templates option. Choose desired earlier created pre-defined template 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.

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 template

You can disable your template any time.

  1. Log in as a user with the JIRA Administrators global permission.
    Choose   > Issues. Select Workflows > Condition Templates to open the Condition Templates page.
    (info) Tip: Use Keyboard shortcutg + g + start typing condition templates
  2. Choose desired template and select View or Edit button. You will be redirected to Template Page
  3. Click disable button. From this time 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 disabled template doesn't allow you check any underlying condition.You can still control what happens if an user try to execute a transition with disabled template.
  5. You can enable your template any time by clicking Enable button.

Conditions template options

Conditions template has several options that can be configured.

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

OptionPossible valueDescription
Template is disabledPass conditionDisabled template works as "always true" condition, without checking the template content

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

Fail conditionDisabled template works as "always false" condition, without checking the template content
 Throw exceptionError is raised and logged to standard JIRA log file. Workflow transition cannot be executed.
Template is not foundPass conditionInvalid or deleted template works as "always true" condition.
Template was deleted or cannot be found for any other reasonFail conditionInvalid or deleted template works as "always false" condition.
 Throw exceptionError is raised and logged to standard JIRA log file. Workflow transition cannot be executed.
Template is emptyPass conditionEmpty template works as "always true" condition.
Template contains no conditionsFail conditionEmpty template works as "always false" condition.
 Throw exceptionError is raised and logged to standard JIRA log file. Workflow transition cannot be executed.
Condition checkingOptimized condition checkConditions are checked until it's clear that transition can/cannot be executed then remaining conditions are omitted.
Method of condition checkingFull condition checkAll conditions in template are checked regardless template logic.

Importing templates

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

Exporting templates

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

 

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

Inversing condition result

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

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

Inversion indicator is displayed next to condition name. You can easily find all inversed conditions when editing a template

When condition is inversed you can see it as below:

  • No labels