Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

when the status changes , status changed time is entered into the Custom date field value.

Jeoung
Contributor
August 5, 2020

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.

1 answer

0 votes
Andrew Morin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2020
Jeoung
Contributor
August 5, 2020

 

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()
)
*/ 
Andrew Morin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2020

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.4.3
TAGS
AUG Leaders

Atlassian Community Events