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).
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.