Jira Issue Closed Date

How do I find the date an Issue was CLOSED? Thanks.

5 answers

1 accepted

6 votes

That's not quite true - resolution date is not always closed date.

The answer to the question givein is simply "look in the issue history", but I suspect there's a further question, in that the poster will want to report on the date directly (for example "closed date < -7d"). JQL doesn't let you interrogate the history quite that easily, and most places won't display the date either (the issue navigator only displays fields, not "stuff we extracted from the history").

To solve this problem in the future, the most easy option is to add a "closed date" date/time field and use a plugin to give a transition post-function that sets this date to "now" when any close transition is used.

Thanks Nic. You are correct. I know where to find dates in issues and I know how to do advanced queries. However, there is no Closed date anywhere that I can query on that I can find and you have confirmed that. I will look to the transition post-function as a solution. Thanks.

Andrey's plugin is nice. You can also createcustom field called Script Field with Scriptrunner plugin to get this information automatically.

Link to documentation how to create Script field:

https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields?src=contextnavchildmode

Code for this Script Field:

import com.atlassian.jira.ComponentManager
def componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
changeHistoryManager.getChangeItemsForField(issue, "status").find {it.toString == "Closed"}?.getCreated()

Hi Susan

You can find this information inside the issue at the right corner at the resolution date.

Hope it helps,

Ricardo Carracedo.

I want to Get Closed Date from script runner with below script. It works but not exact due to Timezone difference. How can I get exact date?

 

import com.atlassian.jira.ComponentManager

def componentManager = ComponentManager.getInstance()

def changeHistoryManager = componentManager.getChangeHistoryManager()

changeHistoryManager.getChangeItemsForField(issue, "status").find {it.toString == "Closed"}?.getCreated().format('dd/MMM/yy HH:mm')

That's the date it was closed... the server date is authoritative. You can adjust it for display to clients, but you haven't given any context so don't know what the circumstance is.

@Jamie Two users - User1 at Time Zone: (GMT+05:45).This is set in user profile. User2 at Time Zone: (GMT-06:00).This is set in user profile. System/apps hosted in Time Zone: (GMT-06:00) getCreated() gives the date at Time Zone: (GMT-06:00). So User2 has no problem. But the user1 gets the date of (GMT-06:00). Whereas other dates like Resolved, Created , updated are in (GMT+05:45). I want to get Closed date in (GMT+05:45) for User1. I want generic solution that can work for any users in any Timezone.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,329 views 14 20
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot