Skip to main content
Book your demo
Example scripts
To homepage
Jira
Cloud icon
Cloud

Time of last status change

Created 6 month(s) ago, Updated 6 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
groovy
def result = get('/rest/api/3/issue/' + issue.key + '/changelog')
        .header('Content-Type', 'application/json')
        .asObject(Map)
// Replace 'In Progress' with the status name
def lastTransitionDateTime = result.body.values.findAll { it['items']['field'].toString().contains('status') && it['items']['toString'].toString().contains('In Progress') }.last()
lastTransitionDateTime ? lastTransitionDateTime['created'] : "-"
Having an issue with this script?
Report it here