hello ,
I'm very new to groovy and
I would like help to write a groovyscript that will copy the date in DUEDATE field to a custom field of date type.
Hi, @ayala nayman
Something like this should do the trick:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.event.type.EventDispatchOptionimport com.atlassian.jira.issue.MutableIssueimport com.atlassian.jira.issue.fields.CustomFieldimport com.atlassian.jira.user.ApplicationUserMutableIssue issue = issueApplicationUser actor = ComponentAccessor.getUserManager().getUserByName("userNameWhoRunsTheScript")CustomField dateField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("customFieldName")issue.setCustomFieldValue(dateField, issue.getDueDate())ComponentAccessor.getIssueManager().updateIssue(actor, issue, EventDispatchOption.ISSUE_UPDATED, false)
thanks a lot ! I used in the escalation services of script runner works great
It looks like you're new here. Sign in or register to get started.