Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set Original Estimate from custom field (select list)

MarcoC March 21, 2013

Hi everybody!

I have a custom field value (select list with text field) that have different choice about the Complexity of the issues.

EX: Complexity: Medium (1 - 2 - 3)

I need to set the Original Estimate (timeoriginalestimate in jiradb) based on the option select in Complexity.

EX: if Complexity is "Medium" than I want to set 6d on the Original Estimate.

Is there a simple way to do this?

.............................................

I found a wonderful plugin (Script Runner) that have a function like "Copy Custom Field Value" that copy the value from one customfield to another customfield...

Like I have write before, I want to do something similar, but:

- not making a copy (because the select list is a text, and the Original estimate is a value)

- working with the Original Esimate (not a customfield)

I have a parameter table that associate Complexity - TIME

Best best best regards,

Marco

5 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Matthew Halladay November 25, 2014

I was having some problems with originalEstimate as well and found that I first needed to set the estimate on the issue, and then store it.  The following works in Script Runner.

issue.setOriginalEstimate(0L)

issue.store()

Hopefully this helps.

0 votes
GerdC November 25, 2013

Hi,

Did you find a solution for this issue.

I'm having the same problems...

Thank you!


Gerd

0 votes
MarcoC March 25, 2013

Hi,

yes it's exactly what I need.

But I have a problem, when I try to set up for example the 'Description' depending on 'complexity' it works fine, instead when I try to set the Original Estimatesit's not working.

This is the code:

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField

FormField formComplexity = getFieldById("customfield_10000")
FormField formOE = getFieldByName("Original Estimate")
String Compl_Value = (String) formComplexity.getFormValue()

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("0h")
}

It seems that ìs not recognizing the field Original estimates. Can someone help me?

Thanks,

S.


0 votes
MarcoC March 25, 2013

Hi,

yes it's exactly what I need.

But I have a problem, when I try to set up for example the 'Description' depending on 'complexity' it works fine, instead when I try to set the Original Estimatesit's not working.

This is the code:

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField

FormField formComplexity = getFieldById("customfield_10000")
FormField formOE = getFieldByName("Original Estimate")
String Compl_Value = (String) formComplexity.getFormValue()

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("0h")
}

It seems that ìs not recognizing the field Original estimates. Can someone help me?

Thanks,

S.


0 votes
dleng
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2013

https://marketplace.atlassian.com/plugins/com.onresolve.jira.plugin.Behaviours

This plugin allows you to set behaviour schemes for your fields, e.g. Setting a field value dependent on other form data

Seems like exactly what you need.

MarcoC March 24, 2013

Thanks.

I'll take a look on it.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events