Page tree
Skip to end of metadata
Go to start of metadata

定义字段

编写脚本

import com.atlassian.jira.component.ComponentAccessor

 

final Long customFieldName1 = 11700L;//期望效果
final Long customFieldName2 = 11701L;//成功信心


def customField1 = ComponentAccessor.customFieldManager.getCustomFieldObject(customFieldName1);
def customField2 = ComponentAccessor.customFieldManager.getCustomFieldObject(customFieldName2);
if(customField1==null||customField2==null){
  0d;
}

def cfValue1 = (Double)issue.getCustomFieldValue(customField1);
if(!cfValue1){
  cfValue1 = 0d
}

def cfValue2 = (Double)issue.getCustomFieldValue(customField2);
if(!cfValue1){
  cfValue1 = 0d
}

cfValue1 + cfValue2



  • No labels