Hi there,
We are currently using ScriptRunner to send auto emails as post-functions. In our email template we are using a date/time custom field (Responses Due By) and the Due date field to communicate required info to our distro groups.
In order to keep the custom Responses Due By field the same as the Due Date field, I'm working on adding another custom scriptpost-function using ScriptRunner to copy the Responses Due By field over to the Due Date field. For some reason it is giving me a 'no failures' but it does not actually copy the custom field over to the Due Date field. I'm hoping that someone can look at my code and tell me what I'm doing incorrectly.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.IssueInputParameters
def mutableIssue = issue as MutableIssue
def issueService = ComponentAccessor.issueService
def customFieldManager = ComponentAccessor.customFieldManager
def issueManager = ComponentAccessor.issueManager
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def responsesDueBy = customFieldManager.getCustomFieldObjectsByName('Responses Due By').first()
def responseValue = issue.getCustomFieldValue(responsesDueBy)
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.setDueDate(responseValue.toString())
issueManager.updateIssue(loggedInUser, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false)