Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
linenumberstrue
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) as double; #获得当前问题的期望效果的值;
if(!cfValue1){
  cfValue1 = 0d
}

def cfValue2 = (Double)issue.getCustomFieldValue(customField2);
if(!cfValue1){
  ascfValue1 double; #获得当前问题的成功信心的值= 0d
}

cfValue1 + cfValue2  #将成功信心和成功信心累加