I made a Custom Date field. ( ex) In-progress time )I would like to enter the time in the In-progress time field when status is changed to In-progress.(It will be used not only for In-progress but also for other status.)I'm using Scriptrunner add-on. Please help me.
This can done with a basic Jira post function.
https://community.atlassian.com/t5/Jira-questions/How-do-I-set-a-custom-field-with-the-current-date-time-in-a-post/qaq-p/143415
The following script was used, but an error occurred.
error -> issue.setCustomFieldValue{
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.UpdateIssueRequest import java.sql.Timestamp issue.setCustomFieldValue( ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("customFieldname") , new Timestamp() ) //only for create transition /* ComponentAccessor.getIssueManager().updateIssue( ComponentAccessor.getJiraAuthenticationContext().getUser() , issue , UpdateIssueRequest.builder().sendMail(false).eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).build() ) */
https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/postfunctions/set-issue-attributes.html
It looks like you're new here. Sign in or register to get started.