0
これは本当に新しいですが、このコードを使用しようとしていて、カスタムフィールド値を更新していません。JIRAでGroovyでcustomFieldの値を設定するJAVA
何か考えてみませんか?私は私の終わりにその光景を推測しています。
Caught: groovy.lang.MissingMethodException: No signature of method: Custom.getTime() is applicable for argument types:() values: []
あそこgetTime()
が起動されていないこと:すべてのヘルプは非常にそれが次のエラーで私に失敗し、スタンドとして
def rush = getCustomFieldValue("Rush?")
if (rush=="Yes") {
def cal = new java.util.GregorianCalendar();
cal.setTimeInMillis(customField.setCustomFieldValue("Rush Date", getTime()));
return new java.sql.Timestamp(cal.getTimeInMillis());
}
else {
return null
}
は、あなたのスニペット
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
def componentManager = ComponentManager.instance
def optionsManager = ComponentManager.getComponentInstanceOfType(OptionsManager.class)
def customFieldManager = componentManager.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("Rush?")
def rush = issue.getCustomFieldValue(cf)
def paymentDate = new Date()
if (rush?.value=="Yes"){
if (paymentDate){
def cal = new java.util.GregorianCalendar();
cal.setTimeInMillis(paymentDate.getTime());
cal.add(java.util.Calendar.DAY_OF_MONTH, 0);
return new java.sql.Timestamp(cal.getTimeInMillis());
}
else {
return null
}}
は正しい方法でカスタムフィールドの値を参照し、私の問題府の鼻水が判明:私はこのように、
cal.setTimeInMillis()
¹が必要とされていない、あなただけのcustomField
でsetCustomFieldValue
にしたいと思います。私もコードを変更しました。 –