Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Is there a way to default the original estimate field to a value based on the issue type selection? In other words, if I create a new issue with the type 'new feature' is there anyway to assign a default estimate value (let's say 16 hours) without requiring the end user to enter one?
Thanks for your response.
Pretty sure you can do this with the JIRA Behaviors Plugin. For example, you could have a Validator Class and Method that would look at the issue type and based on that, set the initial estimate.
This is complete pseudo-code, but you get the idea.
FormField issueType = getFieldById("issueType").getValue() FormField oEstimate = getFieldByName("timetracking_originalestimate") if ( issueType.equals("1001") ) { oEstimate.setFormValue("12h") } else { oEstimate.setFormValue("") }
Is it possible to set a Original Estimate based off a customfield say "Shirt Size" (customfield_10104) so something like this..
FormField oEstimate = getFieldByName("timetracking_originalestimate").getValue()
FormField var = getFieldById("customfield_10104")
if (oEstimate >= 1.0 and oEstimate <= 1.75) ) {
var.setFormValue("S")
}
if (oEstimate >= 2.0 and oEstimate <= 4.75) ) {
var.setFormValue("M")
else {
var.setFormValue("L")
}
Or will this not work because javascript has no notion of time (h/m/dd) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ;
I want to autofill the original estimate field if the priority is set .I used the following code , but its showing error (**) , What's wrong ???
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField
**FormField Priority = getFieldByName("Priority")
**FormField OE = getFieldById("timetracking_originalestimate")
String Compl_Value = (String) formPriority.getFormValue()
if ( formPriority.getValue()==("Critical") )
{ formOE.setFormValue("24h")
}
else if ( formPriority.getValue()==("High") )
{ formOE.setFormValue("3d")
}
else if ( formPriority.getValue()==("Medium") )
{ formOE.setFormValue("24d")
}
else if ( formPriority.getValue()==("Low") )
{ formOE.setFormValue("48d")
}
else
{
formOE.setFormValue("0h")
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I need to do almost the same thing setting original estimates depending on the value of a custom field.
I've used the plugin Behaviours to create a script, but if I try to set a filed for example 'Description' everything works instead if I use the same code to set 'original estimates' it's not working.
Where is the mistake?
FormField formComplexity = getFieldById("customfield_10000") FormField formOE = getFieldByName("originalEstimate") //FormField formRE = getFieldById("Remaining Estimate") String Compl_Value = (String) formComplexity.getFormValue() //String Compl_Value = formComplexity.getFormValue() as String if ( formComplexity.getValue()==("05. Very Very Easy") ) { formOE.setFormValue("1d") } else if ( formComplexity.getValue()==("10. Very Easy ( 0.5a | 2d | 1.5t )") ) { formOE.setFormValue("4d") } else if ( formComplexity.getValue()==("20. Easy ( 1a | 4d | 2t )") ) { formOE.setFormValue("7d") } else if ( formComplexity.getValue()==("30. Easy/Medium ( 2a | 8d | 2t )") ) { formOE.setFormValue("12d") } else if ( formComplexity.getValue()==("40. Medium ( 2a | 15d | 3t )") ) { formOE.setFormValue("20d") } else if ( formComplexity.getValue()==("50. Medium/Complex ( 4a | 20d | 4t )") ) { formOE.setFormValue("28d") } else if ( formComplexity.getValue()==("60. Complex ( 5a | 30d | 5t )") ) {formOE.setFormValue("40d") } else if ( formComplexity.getValue()==("70. Very Complex") ) { formOE.setFormValue("60d") } else { formOE.setFormValue("0") }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like you're using getFieldByName instead of getFieldById... have you tried it with different combinations of byId or byName using "originalEstimate" or "Original Estimate", etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I've tried to use also byId, but it's not working.
I think I've tried amlost every combination and no one works. I think it's a problem related to the type of field (that is like 1w 3d...), but I don't know how to solve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To modify the original estimate, the field id is "timetracking_originalestimate". It sure would be nice if there was a guide somewhere that listed all the available JIRA field IDs. I couldn't find anything and only figured this out by inspecting the HTML source of the edit form.
FormField formOE = getFieldById("timetracking_originalestimate")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much! This is working finally!!
I've tried to search for some documentation, but I haven't find anythig..I agree with you that wolud be nice if they put some guide about it.
Thank you again,
S.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.