You can add a post-function that notifies the assignee of the ticket to add the time spent on the ticket. You should add this to the transition which leads to the status that is before "Done" status in the workflow.
But the best way is to handle this use case is to add a validator to block the user from transitioning to the Done status without entering the time spent on the issue
I can confirm that ScriptRunner for Jira Cloud does not provide the functionality to create scripted conditions and validators like ScriptRunner for Jira Server does as described in the KB articles located here and here.
I can also confirm that you can see more detailed information on the differences between ScriptRunner for JIRA Cloud and ScriptRunner for JIRA Server inside of the documentation page located here.
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events