Conditional Execution Samples
The following are a few examples of how to use Conditional Execution, including the Nunjucks templates that should be used within a post-function utilizing the sample.
Some of the examples below include additional project configurations or custom fields.
Assign ‘Bug’ issues to the Product Owner
Create a Product Owner project role, with your product owner as the only member.
Add the Assign to role member post-function to the Create transition of the issue workflow.
In the post-function configuration, select Product Owner for the Project Role field.
Select the checkbox under Conditional execution.
In Condition, enter
{{ issue.fields.issuetype.name == "Bug" }}
Assign ‘Bug’ issues to Product Manager when priority is ‘Critical’
Add the Assign to role member post-function to the Create transition of the issue workflow.
In the post-function configuration, select Product Manager for the Project Role field.
Select the checkbox under Conditional execution.
In Condition, enter
{{ issue.fields.issuetype.name == "Bug" and issue.fields.priority.name == "Critical" }}
Copy value from ‘Affects versions’ to ‘Fix versions’ when resolution is ‘Fixed’
This example is only applicable to Jira Service Management (JSM), unless you have customized your project to include similar fields.
Add the Copy issue fields post-function to the Close transition of the issue’s workflow.
Under Fields to copy, select Affects versions for Source field.
Also under Fields to copy, select Fix versions for Destination field.
Select the checkbox under Conditional execution.
In Condition, enter
{{ issue.fields.resolution.name == "Fixed" }}
Automatically transition High priority issues to ‘In Progress’
Add the Transition issue(s) post-function to the Create transition of the issue workflow.
Under Transition(s), select the transition name or ID for the transition that points to ‘In Progress’ (e.g. Start Progress).
Select the checkbox under Conditional execution.
In Condition, enter
{{ issue.fields.priority.name == "High" or issue.fields.priority.name == "Highest" }}
Automatically transition issues created by ‘Service Desk Customer' project role
Add the Transition issue(s) post-function to the Create transition of the issue workflow.
Under Transition(s), select the transition name or ID for the transition that points to ‘In Progress’ (e.g. Start Progress).
Select the checkbox under Conditional execution.
In Condition, enter
{{ issue.fields.reporter | isInRole("Service Desk Customers") }}
You are viewing the documentation for Jira Cloud.
Â