Resolving an issue means you are executing a workflow transition. In this transition, you should already get a screen with the Resolution field on it, which I would expect to be required just as well.
Check your workflow to see what screen is being used on that transition. Just add the Log Work field to that screen:
Screen Shot 2016-12-17 at 16.29.48.png
If you have your screen configured like this (Fix Version/s and Assignee are just 2 other fields on the screenshot; not necessary with regards to your question, but I'm sure you get the point), add a Fields Required validator to the transition for the Time spent field.
This results in the following behaviour:
Before you implement this solution, verify if you can really enforce this (i.e. check if there are no corner cases where resolving an issue does not require any time spent) and check in which other projects your workflow is being used as well. Your change will impact those projects as well.
I second Alex on his point that not in all cases a work log might be required. That's what I meant when I said you should verify whether you can really enforce 'to make a worklog required when resolving an issue'. I would personally be careful too before you make logging work required. But that's an assessment you have to make for your own situation.
Scriptrunner can most definitely help you in validating whether there already are existing worklogs on your issue. But no automatic system will ever be able to validate whether your worklogs are actually complete or not. Not if there already are, but probably even when there are none. That's something that only the person doing the work knows.
So if you want to offer your users the capability and the incentive to log work during the Resolve issue transition, make sure you offer them the field. If you want to make the field required or not is a decision you would have to take for your situation. If you want to implement additional logic to validate the existence of worklogs, add a script validator.
In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to have–in order to produce a reliable long-term roadmap. We're tur...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs