Forums

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

How to calculate the 2 system date fields in jira like create date and updated date

Madhu
April 18, 2023

How to calculate the 2 system date fields in Jira like create date and updated date

I have written below code  for calculating the two system fields.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue;
import java.util.Date.*

def createdDate = issue.getCreated()
log.warn("Date Created: " + createdDate)
def updatedDate = issue.getUpdated()
log.warn("Updated Date: " + updatedDate)
{
def daysDiff = createdDateValue - updatedDateValue
return daysDiff
}

1 answer

0 votes
Sana Safai
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 Champions.
June 18, 2018

Do you have an XML or database backup? It's the only way to get it back.

Another option is if you have a test environment that uses older data.

Suggest an answer

Log in or Sign up to answer