You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.