Block a transition if a predefined field value has not been changed

Use case

Evaluate a Date Picker field and block the transition if it has not been updated.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Prerequisites

Set a predefined field value

Add the post function Update fields to the transition of your choice.

Target issue*

Select current issue.

Fields

Field*

Choose a date field, e.g., Date picker, Planned end date, Planned start date, Due date...etc.
In this example, we will consider due date as our date field.

Value*

Select Set field value manually (parser expression) and enter the following expression with the date of your choice respecting this format.

Bash
1970-01-01

🛠️ Configuration

Jira expression*

Compare the field code of the custom field with the date introduced previously in the Update fields post function as in the following expression.

Bash
issue.customfield_10001 != "1970-01-01"

Variations

Select list (single choice)

Bash
issue?.customfield_20002?.value == "Option 01"

Select list (multiple choice)

Bash
issue?.customfield_10051?.map(e => e.value).includes("Option 01")

Valid only for one value of the select list.

Number field

Bash
issue.customfield_30003 != 10

Checkbox

Bash
issue?.customfield_40004?.map(c => c.value).includes("Option 01")

Valid only for one value of the checkbox.

Date Time Picker

Bash
issue?.customfield_10049 == "2022-10-29T15:28:00.000+0200"

Short text (plain text only)

Bash
issue?.customfield_10050 == "Short text."
Use case Workflow function Use case description
Block a transition based on the day of the week

Jira expression condition

Jira expression validator

Block transitions on weekends or any other day of the week.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Check whether an attachment was added during the transition.

Jira expression condition

Jira expression validator

Make sure that the current user has uploaded a attachment during the transition. 

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Evaluate worklogs in sub-tasks

Jira expression condition

Jira expression validator

Evaluate if work has been logged in a sub-task to prevent transitioning the parent issue when no work has been logged.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Check if an attachment was added recently

Jira expression condition

Jira expression validator

Make sure that the current user has uploaded a attachment during a definite period of time.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Block a transition if some issues under an epic are not in a certain status

Jira expression condition

Jira expression validator

Check whether an epic has all issues under it in a certain status.

This is particularly important if you want to block an epic as long as work is still being done on related sub-tasks.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Block a transition if a predefined field value has not been changed

Jira expression condition

Jira expression validator

Update fields

Evaluate a Date Picker field and block the transition if it has not been updated.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Block a transition based on issue links

Jira expression condition

Jira expression validator

Evaluate issue links and hide transitions based on the outcome.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Validate worklogs

Jira expression condition

Jira expression validator

Evaluate if a user has logged more than a certain amount of time in the latest worklog.


Check current issue status

Jira expression condition

Jira expression validator

Check whether the current issue is in a particular status.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Evaluate the Parent field

Jira expression condition

Jira expression validator

Evaluate different values of the issue in the Parent Link field of the transitioned issue.

This use case is valid for both conditions and validators . The only difference is that you can specify an additional error message when using a validator.

Validate an issue only if a comment is written during the transition

Jira expression validator

Evaluate the comments and block transitions based on the outcome.

This use case is only valid for validators as it involves making changes during a transition. An additional error message can be added.

Block a transition based on sprint information

Jira expression condition

Jira expression validator

Make sure that an issue is not in an active sprint.

This use case is valid for both conditions and validators . The only difference is that you can specify an additional error message when using a validator.

Check the number of times that a field has changed

Jira expression condition

Jira expression validator

Check the number of times that a field has changed.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Check parent issue type

Jira expression condition

Jira expression validator

Check whether the parent of the current issue is of a certain issue type.

This is particularly important if you want to reuse a workflow for multiple sub-task issue types but only want a transition to be available if the sub-task belongs to a certain user story or a bug.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Check for unresolved sub-tasks

Jira expression condition

Jira expression validator

Check whether the current issue has any unresolved sub-tasks.

This is particularly important if you want to block a parent issue as long as work is still being done on related sub-tasks.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.