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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you