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!
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.
Disabling template
You can disable your template 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 Keyboard shortcut: g + g + start typing condition templates - Choose desired template and select View or Edit button. You will be redirected to Template Page
- 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.
- 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.
- 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
Option | Possible value | Description |
---|---|---|
Template is disabled | Pass condition | Disabled 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 condition | Disabled template works as "always false" condition, without checking the template content |
Throw exception | Error is raised and logged to standard JIRA log file. Workflow transition cannot be executed. | |
Template is not found | Pass condition | Invalid or deleted template works as "always true" condition. |
Template was deleted or cannot be found for any other reason | Fail condition | Invalid or deleted template works as "always false" condition. |
Throw exception | Error is raised and logged to standard JIRA log file. Workflow transition cannot be executed. | |
Template is empty | Pass condition | Empty template works as "always true" condition. |
Template contains no conditions | Fail condition | Empty template works as "always false" condition. |
Throw exception | Error is raised and logged to standard JIRA log file. Workflow transition cannot be executed. | |
Condition checking | Optimized condition check | Conditions are checked until it's clear that transition can/cannot be executed then remaining conditions are omitted. |
Method of condition checking | Full condition check | All conditions in template are checked regardless 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 Keyboard shortcut: g + g + start typing condition templates - Click the Import button.
- 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:
- 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 Keyboard shortcut: g + g + start typing condition templates - Select template that you want to be exported and click Edit in Operations section
- 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: