Hi All
I created three custom fields for statistical data, in which the first and second fields are filled in manually by the user, and the third field automatically obtains the sum of the values of the first two fields, but I do not know how to assign values, the following is my code
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def filed = customFieldManager.getCustomFieldObject('customfield_14300')
def filed1 = customFieldManager.getCustomFieldObject('customfield_14301')
def filed2 = customFieldManager.getCustomFieldObject('customfield_14302')
def a = issue.getCustomFieldValue(filed)
def b = issue.getCustomFieldValue(filed1)
I try to use
def c = a+b
issue.setCustomFieldValue(filed2,c)
I got an error when I did this. I tried to convert the field value using "toDobule ()", but it doesn't seem to allow me to do so
All three custom fields are numeric fields (not text fields). How can I optimize the code to achieve the effect I want