Prevent a Transition If No Time Logged
Restrict Transition Rules vs Validate Details Rules
You may want to ensure that work has been logged on an item before the item can be transitioned to the next status. Depending on the situation, you can do this with either a Restrict transition rule or a Validate details rule.
Restrict Transition Rules
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.
Validate Details Rules CLOCKWORK PRO ONLY
A validation rule 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.
These rules only work in Company-managed spaces.
Create a Restrict Transition Rule (Condition)
You can create a workflow rule to ensure that the Jira work item has time logged before it can be transitioned to a new status. If no time is logged, the transition will not be shown as an option.
Navigate to Space settings > Workflows
Click Edit workflow.

Select the transition where you want to add the rule and click on the Rules + sign.

Click on Restrict transition and Restrict to when a field is a specific value.

Click Select.
Complete the form:
For this field Time Spent
Review its value as A number
Check if it Is greater than
This value 0

Select Add.
Click Update workflow to save the changes.


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.
Validate that Time Logged
The time-logged validation rule is only available available in Clockwork Pro.
For the validation rule to work, it must be enabled in the Clockwork Space settings.
The Clockwork time logged validation rule 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 Validation Rule
Navigate to Space settings > Workflows
Click Edit workflow.

Select the transition where you want to add the rule and click on the Rules + sign.

Click on Clockwork Pro for Jira Time Tracking and Timesheets under Marketplace Rules and select Clockwork time logged.

Click Select.
Click Add.

Click Update workflow to save the changes.

Enable the Validation Setting
Navigate to Space settings > Apps > Clockwork Pro.
Select the Time Tracking tab.
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 theTime is logged validationin project setting prior to removing the workflow validator can result in work items becoming indefinitely blocked from transitioning.
Limitations
Note that the validation rule:
Only works in Company-managed projects.
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.