Hey there,
we've been tasked to enforce users in a specific project to set a value for "Remaining Value" -> "Set to" when logging work (both in WorkFlow-Functions and when logging work manually).
I see two ways of accomplishing that:
However, I wasn't able to accomplish that using native options. We do have ScriptRunner on our hand, so that's another possibility, if that value can be checked at all.
If anyone has an idea on how to built this, I'd be very thankful for your help.
Hello there,
did anybody try this ? or have anyone an idea how can we go with this requirement?
Also tried using Script Runner Behaviours which works well with TimeSpent if we set Initialiser or any code but it does not work with Remaining Estimate. Maybe someone have treid in that direction ?
Will be happy to get any lead.
Thanks,
PreetiD
Hey , @[deleted] I got this solved using ScriptRunner behaviours.
Just add a simple Behaviour and call it whatever you want. Map it to the project and eventually restrict the issue types it'll affect.
Insert the following code into the initializer:
def field = getFieldById("log-work-time-logged")
field.setDescription("""
<script>
document.querySelector('#log-work > div.form-body > fieldset > fieldset > div:nth-child(4) > label').click();
queries = ['#log-work > div.form-body > fieldset > fieldset > div:nth-child(2)',
'#log-work > div.form-body > fieldset > fieldset > div:nth-child(2)',
'#log-work > div.form-body > fieldset > fieldset > div:nth-child(3)']
for (idx in queries) {
element = document.querySelector(queries[idx]);
element.parentNode.removeChild(element);
}
</script>
""")
This will enforce the field "Remaining Estimate: Set to" by hiding all other options and selecting "Set to" as default.
And that's it!
This script doesn't enforce a remaining estimate larger than 0, it just enforces that the field is not empty. So users will still be able to add 0 as remaining estimate, even if the issue isn't finished yet. Maybe you find a way to adjust that, if needed.
Have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey @Leonard Winck thanks for the script. Just to add. Its working in the log work screen but not in Transitions. So looking further if it can work through Behaviours also in Transitions.
In Log Work Screen also it does not show that its required (*) on the screen but if we do not enter Remaining Estimate then it gives the error. That should work as of now but we can keep looking if its possible to show it required on screen.
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.