Want to add one script field with below code. I am trying to achive division of custom filed with a number and output should store in my script field.
i have custom field A in my jira. Want to create Script field 'B'. B will store result of 'A'/1848.
Code:
import com.atlassian.jira.component.componentAccessor
import com.atlassian.jira.issue.Issue
def customFieldManager = componentAccessor.customFieldManager
def Benefits_EstCFID = 54700
def Benefits_EstCF = customFieldManager.getcustomFieldobject(Benefits_EstCFID)
if (!Benefits_EstCF) {
log.debug ("custom field with ID" + Benefits_EstCFID + "not found")
return null
}
def Benefits_Est = issue.getcustomFieldvalue(Benefits_EstCF)
return Benefits_Est/1848
Jira is giving result. But also failing the health condition on each execution at last line where i am dividing 'A' /1848