Hi,
I'm trying to get the default value of a number field. I need this deafault value for a calculation, therefore it has to be a double. The default value of weight is 0.2
def weight = Double.valueOf(issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Weight")).getValue()); def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Customfield"); issue.setCustomFieldValue(cf, weight);
Best regards,
Louisa
Try using .floatValue()
and casting def to double by using (double).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.