Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,036
Community Members
 
Community Events
176
Community Groups

Days In Status

Been wrestling with how to know how many days an item has been in the current status. Well with the help of our community, I put together some ScriptRunner fields that seems to be doing the job for me.

Fist I created a Time of Last Status Change fields using Script Runner's Field feature. This is a provided feature. I called this field Status Change Date.

Then I created another field using the Custom Script Field. I took today's date minus the Last Status Change field (created above) and output it as a number.

Code in the Days Since Created field using the Custom Script field

import com.atlassian.jira.component.ComponentAccessor
import java.sql.Timestamp
import java.time.DayOfWeek
import java.text.SimpleDateFormat


import com.atlassian.core.util.DateUtils
import com.atlassian.jira.datetime.LocalDate

def enddate = new Date() as Date
def startdate = issue.getCreated()

Integer daydelta = enddate - startdate

return daydelta

 

This community has been a great help to me and I hope this helps others

 

0 comments

Comment

Log in or Sign up to comment