Excerpt | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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 templates. What are the conditions in the first place? 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 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 click the Edit button in the Operations section. You will be redirected to the Edit Worklow page where you can see all the transitions that take place as shown below:
Click a desired transition and than then choose which of the worfklow 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 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 Use a Keyboard shortcut: g + g + start typing condition templates - Choose a desired template and select the View or Edit button. You will be redirected to the Template Page
- 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.
- 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.
- 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 separately. Condition templates options are as listed below.
Option | Possible value | Description |
---|---|---|
Template is disabled | Pass condition | Disabled A disabled template works as a "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 A disabled template works as a "always false" condition, without checking the template content. |
Throw exception | Error An error is raised and logged to a standard JIRA log file. Workflow The workflow transition cannot be executed. | |
Template is not found | Pass condition | Invalid An invalid or deleted template works as a "always true" condition. |
Template was deleted or cannot be found for any other reason | Fail condition | Invalid An invalid or deleted template works as a "always false" condition. |
Throw exception | Error An error is raised and logged to a standard JIRA log file. Workflow The workflow transition cannot be executed. | |
Template is empty | Pass condition | Empty An empty template works as a "always true" condition. |
Template contains no conditions | Fail condition | Empty An empty template works as a "always false" condition. |
Throw exception | Error An error is raised and logged to a standard JIRA log file. Workflow 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 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 Use a Keyboard shortcut: g + g + start typing condition templates - Click the Import button.
- 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:
- 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 Use a Keyboard shortcut: g + g + start typing condition templates - Select the template that you want to be exported export and click Edit in the Operations section
- 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.
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: