Introduction
So, you've already known what the templates are. How about getting deeper? Let us show you the real power of our plugin. Let's start with condition templates. What are the 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 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 the same and yet they have to be entered. And this is where Workflow PowerBox comes in handy giving you the possibility to gather all parameters in one place, save it as a template and then re-use it wherever you want!
Creating a new template
Templates are useful as they make your work easier and faster. But how to use them? Let's create your very first condition template!
Creating a template is possible for any user that has the Jira Administrators' permission. The administration panel where you can create a template is located in the Workflows Section.
Executing a template
Executing a template means nothing more than adding a template to the chosen transition in a workflow. As soon as you have all workflows listed you have to select one of them and click the Edit button in the Operations section. You will be redirected to the Edit Workflow page where you can see all transitions that take place as shown below:
Click the desired transition and then choose which of the workflow elements you want to extend (conditions, validators or post functions) with a predefined template.
From the list of conditions choose the Run Condition Templates option. Choose 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 run for this particular transition.
Remember to publish the draft of a workflow so your changes will be considered.
Disabling a template
You can disable your template at any time.
- Log in as a user with the Jira Administrators global permission.
Choose > Issues. Select Workflows > Condition Templates to open the Condition Templates page.
Tip: Use a Keyboard shortcut: g + g + start typing condition templates - Choose the desired template and select the View or Edit button. You will be redirected to the Template Page
- Click the disable button. From 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.
- Note that a disabled template doesn't allow you to check any underlying condition. You can still control what happens if a user tries to execute a transition with a disabled template.
- You can enable your template at any time by clicking the Enable button.
Conditions template options
A conditions template has several options that can be configured.
You can configure plugin options for each type of template separately. Condition templates options are listed below.
Option | Possible value | Description |
---|---|---|
Template is disabled | Pass condition | A disabled template works as the "always true" condition without checking the template content. |
The template has been disabled by an administrator, and no condition check against the template will be performed | Fail condition | A disabled template works as the "always false" condition, without checking the template content. |
Throw exception | An error is raised and logged to a standard Jira log file. The workflow transition cannot be executed. | |
A template is not found | Pass condition | An invalid or deleted template works as an "always true" condition. |
A template was deleted or cannot be found for any other reason | Fail condition | An invalid or deleted template works as an "always false" condition. |
Throw exception | An error is raised and logged to a standard Jira log file. The workflow transition cannot be executed. | |
Template is empty | Pass condition | An empty template works as the "always true" condition. |
The template contains no conditions | Fail condition | An empty template works as the "always false" condition. |
Throw exception | An error is raised and logged to a standard Jira log file. The workflow transition cannot be executed. | |
Condition checking | Optimized condition check | Conditions are checked until it's clear that the transition can/cannot be executed and then the remaining conditions are omitted. |
Method of condition checking | Full condition check | All conditions in a template are checked regardless of the template logic. |
Importing templates
- Log in as a user with the Jira Administrators global permission.
Choose > Issues. Select Workflows > Condition Templates to open the Condition Templates page.
Tip: Use a Keyboard shortcut: g + g + start typing condition templates - Click the Import button.
- Choose the XML file you want to upload and 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:
- Log in as a user with the Jira Administrators global permission.
Choose > Issues. Select Workflows > Condition Templates to open the Condition Templates page.
Tip: Use a Keyboard shortcut: g + g + start typing condition templates - Select the template you want to export and click Edit in the Operations section
- As soon as you choose the Export button, your template will be downloaded.
Inversing a condition result
Templates allow you to "inverse" a condition result. As a result, any failed condition is treated as passed and the other way round. This option is particularly useful when you look for a way to run such "except-type" conditions 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.
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: