HI i have 2 fields. one is filled in the creation from.
but the other, need to filled by a condition.
the due date need to have a working/business day. (not saturday and not sunday) then, for example If my hiring date is monday. I need to substract the days until the last working/business day (friday).
import java.sql.Timestamp
import com.atlassian.jira.issue.fields.CustomField
def cf_duedate = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Due Date'}
Timestamp HiringDate = (Timestamp) getCustomFieldValue("Hiring Date")
if (HiringDate [Calendar.DAY_OF_WEEK] == Calendar.SATURDAY){
HiringDate = HiringDate - 1
issue.setCustomFieldValue(cf_duedate, HiringDate)
}
if (HiringDate [Calendar.DAY_OF_WEEK] == Calendar.SUNDAY){
HiringDate = HiringDate - 2
issue.setCustomFieldValue(cf_duedate, HiringDate)
}
in the log I'm see an error message
2018-04-25 11:35:41,159 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: POPA-3, actionId: 1, file: null
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getCustomFieldValue() is applicable for argument types: (java.lang.String) values: [Hiring Date]
at Script1035.run(Script1035.groovy:5)