Forums

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

How to get the Status modified date of an Issue using JAVA API?

arunk March 7, 2018

 

I wanted to get the date when the status was modified from one status, kindly help me to find a way.

 

I am able to get the status object using "issue.getStatus()" but it didn't have any date field.

1 answer

1 accepted

1 vote
Answer accepted
Kyle Moseley
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.
March 7, 2018

Try this:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("NPB-3") // your issue key here
def statuses = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue, "status").reverse().each{ it ->
log.debug "from status ${it.fromString} to status ${it.toString} on ${it.created}"
}
arunk March 11, 2018

@Kyle MoseleyThanks for your Reply.

I used the below code to get all the changeHistory of an Issue.

List<ChangeItemBean> changeItemBeans = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue,
                "status");

Also i hope using this i can get the work logged date.

Suggest an answer

Log in or Sign up to answer