Hello there,
i am facing an issue with a post function.
When i want to close an issue, i get a transition screen.
In the screen i get a cloture date (custom field). I want to set this field by default with the date of the current day.
To reach my goal, i set a post function in my transition where i define my transition screen.
The post function triggered a custom script (describe below).
When i use the transition:
i) the field isn't set with the date of today
ii) when i want to save and move on to a close the issue i get an error according to the JAVA date library.
I dont get it, I use another similare script in the same WF and it's works well (triggered by postfunction too)
Here is my script:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import java.util.Date.*;
def Issue issue = issue
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
def cfdatedefin = customFieldManager.getCustomFieldObject("customfield_10204")
Date Today = new Date()
cfdatedefin.setFormValue(Today.toString())
Do you have any information to help me on this point?