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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • 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

how to get 'Time In Source Status' like on Transition Tab?

my jira version is 4.4.1

i want to obtain spent time from Open status to Resolved status,and display the spent time in one custom field.

and find 'Time In Source Status' on Transition Tab is like what i want.

but i don't know how the 'Time In Source Status' comes from ?

7 answers

1 accepted

0 votes
Answer accepted

Did you try using scripted fields provided by Script runner plugin ? There is a similar script provided in the docs

You will need to modify it to suit your requirement , you will need to add one field for each status.


i used Scripted Field,below code is used to obtain time spent from first 'Open Status' to 'In Progress Status

import com.atlassian.core.util.DateUtils
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.history.ChangeItemBean
import com.atlassian.jira.issue.Issue 
def componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
def rt = [0]
def createTime=issue.getCreated().getTime() // getTime() tranfer to milliseconds
log.warn("create time:"+issue.getCreated().toString()+"to millisecond:"+issue.getCreated().getTime())
def firstStart=changeHistoryManager.getChangeItemsForField(issue, "status").find{
it.fromString=="Open" && it.toString=="In Progress"

if(firstStart){ //has Start Progress
        // NOTE: doesn't show anything if less than 60 seconds
        log.warn("Duration:"+Duration+"round:"+Math.round(Duration / 1000)+"timespent:"+DateUtils.getDurationString(Math.round(Duration / 1000)))
        def timeSpent=DateUtils.getDurationString(Math.round(Duration / 1000))
                return timeSpent
        }else{ //negative value or less than one minute
                return "less than one minute"
}else{ //there aren't workflow transitions executed yet.
	def timeSpent = System.currentTimeMillis() - createTime


There is a Time in Status Plugin on marketplace. You can get reports depending on user, project and advanced mode. You can export the reports to excel also.

Tansu Akdeniz


Thank you for your work it is very usefull

Yes, the Issue History Collector aka datacollector worked well for us

Hi Andrey, thanks for this plugin, i see lot of positive feedback on this, can we get this data in filters so that we can create report multiple issues, like status, time in that status, assignee etc. columns in filters, same can be displayed in dash board Appreciate your help and support on this. Thanks Raj


Thank you very much for your work it is very usefull


Thank you for your work it is very usefull

We have a plugin vertygoSLA which captures that information. This is a plugin to monitor and track SLA compliance. This is however not a free plugin but you can try it for free for 30 days.


Transition tab comes from JIRA Suite Utilities. What do you mean by 'you want to use post function'?

i just want to use post function

hi Renjith

i just want ot retrieve the time spent from Open status to Resolved status. and store the spent time in one custom field.

so i consider using post function to obtain the spent time. and store the value in custom field.

i don't want to use script file to run groovy code , but i can not find any place to put my own groovy code.

i find the "Script Post-Function" ,it has 'Built-in-Scripts' and 'Script file path'.

Suggest an answer

Log in or Sign up to answer

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