// field cnTest script
// (initialisation) (3 field numeric in my form)
def totalField = getFieldByName("CnTest")
def fieldA = getFieldByName("Cn1")
def fieldB = getFieldByName("Cn2")
// here i get the value of my form field
def total = totalField.getValue()
def totalA = fieldA.getValue()
def totalB = fieldB.getValue()
mistake
total = totalA + totalB
but work with : total= fieldA.getValue().toString() + fieldB.getValue().toString() i dont want 59 but 5 + 9 = 14
// add to a form
totalField.setFormValue(total)
///////////
in my form
cn1 = 5
cn2 = 9
i try something but my answer is 59
i think getvalue give me a text field but i specify in my jira numeric
im confused
thank you if you can help me
Find and work
// déclaration des champs
def totalField = getFieldByName("CnTest")
def fieldA = getFieldByName("Cn1")
def fieldB = getFieldByName("Cn2")
// obtenir les valeurs
//int total = totalField.getValue() as Integer
int totalA = fieldA.getValue()as Integer
int totalB = fieldB.getValue() as Integer
totalField.setFormValue(totalA + totalB)
//return total
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.