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
}
You'll need to convert the return value from milliseconds up to days (I think it's milliseconds, not seconds) - divide by (1000 * 60 * 60 * 24)
hi @Madhu
I can see that you are on the JIRA cloud version. could you please explain the business context or what is the final outcome/output you are expecting.
I can see also that you are trying using scriptrunner which is powerful tool by the way but you can also achieve many things easily using JIRA Automation with low code and low maintenance.
Awaiting your feedback to propose the proper solution according to your needs and context.
Cheers,
Karim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.