Skip to main content
Skip table of contents

Prevent a Transition If No Time Logged

https://youtu.be/MRVk5wPzt1E

Conditions vs Validators

You may want to ensure that work has been logged on a work item before the item can be transitioned to the next status. Depending on the situation, you can do this with either a workflow condition or a workflow validator:

Condition

  • Is checked before the user is given the opportunity to transition the work item. If the condition fails, then the target statuses will be hidden.

  • The Time Spent condition ensures time was logged on any previous status.

Validator CLOCKWORK PRO ONLY

  • A validator is executed when a work item is transitioned. If the validation fails, the item will not be able to transition to the next status and the user will see an error message.

  • The Clockwork time logged validator ensures time was logged in the status the work item is transitioning from.

Create a Workflow Condition

You can create a workflow condition to ensure that the Jira work item has time logged before it can be transitioned to a new status.

  1. Go to Jira Settings > Work items > Workflows.

  2. Find the appropriate workflow and click Edit.

  3. From the Diagram mode, click on the transition arrow. (Note that if you have more than one transition going to the Done status, you’ll need to create a condition for each transition.)

  4. A popup window will open showing behaviors that can be added to the transition.

  5. Click on the word Conditions.

  6. Click the Add condition button.

  7. Select Value field and click Add.

  8. A new page will open. Select Time Spent as the Field, > as the condition, 0 as the value and Number as the comparison type.

  9. Click Add. Note that this condition only checks that some time was spent on the work item. It does not check when the time was logged, who logged the time or what status the item was in when the time was logged.

  10. Click Publish draft. Now an issue cannot be transitioned to the DONE status without logged time.

You can put a workflow condition on any transition, not only the transition to DONE.

Limitations

Note that the workflow condition:

  • Only works in Company-managed projects.

  • Will pass if there is any time logged on the work item, regardless of the user who logged the time.

  • Will pass regardless of which status the work item was in when time was logged.

Create a Workflow Validator

The time-logged validator is only available available in Clockwork Pro.

The Clockwork time logged validator can be set on any transition in a workflow to ensure that time spent is logged before a work item can be moved to another status. The validator functions regardless of whether the item is being transitioned manually, via automation or with an API call.

Two steps are required. First you need to add a validator to the appropriate transition(s) in your Jira workflow. Second, you need to enable validation in the Clockwork project settings.

Configuring the Workflow Validator

  1. Go to Jira Settings > Work items > Workflows.

  2. Find the appropriate workflow and click Edit.

  3. From the Diagram mode, click on the transition arrow. A popup window will open showing behaviors that can be added to the transition.

  4. Click on the word Validators.

  5. Click the Add validator button.

  6. Select Clockwork time logged and click Add.

  7. Click Publish draft to save the changes to you workflow.

Enable the Validation Setting

  1. Navigate to Project Settings > Clockwork.

  2. Select the Time Tracking tab.

  3. Use the toggle to enable Time is logged validation.

Disabling Validation

If you wish to disable a validation rule, remove the validator from the Jira workflow first. Disabling the Time is logged validation in project setting prior to removing the workflow validator can result in work items becoming indefinitely blocked from transitioning.

Limitations

Note that the validator:

  • Only works in Company-managed projects.

  • The Clockwork time logged validator does not take into account any time that was logged before the validator was put in place. For work items with existing worklogs, you will have to update the worklog (or create a new one) to trigger a recalculation of Clockwork validation state.

  • There may be rare circumstances beyond Clockwork’s control (network latency, Atlassian incidents, etc.) that allow the transition to occur even if there is no time logged.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.