I'm using ScriptRunner's Fields Changed Validator to make sure the Time Spent (the validator notes this as "Log Work") field is changed during a workflow transition. I can see that this validator is accurately preventing the transition from working if Time Spent is not entered on the transition screen, however this validator doesn't tell the user what is wrong - the transition screen just sits there until the user guesses at the field that is preventing the transition.
Using the latest ScriptRunner and Jira Software Server LTS at the moment.
A quick workaround is to use Simple Scripted Validator instead. I found this Community discussion that can be useful for this case.
The script to be used:
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.MutableIssue
Map<String,ModifiedValue> modifiedValues = ((MutableIssue)issue).getModifiedFields();
return modifiedValues.containsKey("worklog")
Nice find.
I'm not super familiar with the getModifiedFields() method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the workaround, I confirmed this works on the dev/test server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This seems like something you should report to productsupport.adaptavist.com/servicedesk
But if you don't want to wait for a fix, you can create a simple scripted validator instead:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestion, but the simple scripted validator doesn't work. If I put time in the Time Spent field during the transition it still throws the validation message. We've had this issue forever with checking for issue links added during transitions as well.
I'll see where I can get with Adaptavist support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct, I obviously hadn't tested my suggestion.
Like you, I can't figure out how to access the log work details submitted as part of a transition screen.
But maybe I can suggest a different workaround using behaviour. It's still not perfect.
This issue I have here, is that the message is only visible when you've checked the "log work" box to expand and view the dependent fields. The form is still prevented from submitting, however. So maybe tagging the error to another field would be necessary
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.