Hi,
Our situation is that we have a few developers who would like to break Story Points into
Dev and QA Story Points. I would like to sum Dev and QA in the Story Points field using Behaviors.
I only want Story Points to be the sum of Dev and QA if either value is not null (since some users do not want to split the Story Points).
I put this code in both Dev and QA fields.
Only works if both Dev and QA are not null, then the sum is calculated in Story Points. However, I tried to make it so if one of the fields is not null and the other is null, Story Points is the value of the not null field. This does not work.
def qa = getFieldById("customfield_11034")
def dev = getFieldById("customfield_11033")
def sum = getFieldById("customfield_10103")
def qavalue = qa.getValue() as Integer
def devvalue = dev.getValue() as Integer
if (qavalue != null && devvalue == null) {
sum.setFormValue(qavalue);
}
else if (devvalue != null && qavalue == null) {
sum.setFormValue(devvalue);
}
else if (qavalue != null && devvalue != null) {
return sum.setFormValue(devvalue + qavalue);
}
else return null;