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,555,642
Community Members
 
Community Events
184
Community Groups
  • Community
  • Products
  • Jira
  • Questions
  • how does the resolution date and time get set? We have conditions in the workflow to change the resolution status. This is also setting the resolution date and time. How can we prevent the date and time to set before the issue is marked fixed?

how does the resolution date and time get set? We have conditions in the workflow to change the resolution status. This is also setting the resolution date and time. How can we prevent the date and time to set before the issue is marked fixed?

how does the resolution date and time get set? We have conditions in the workflow to change the resolution status. This is also setting the resolution date and time. How can we prevent the date and time to set before the issue is marked fixed?

4 answers

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 10, 2013

You can't. Resolution date/time is not a real field, it is derived directly from the history, and the derivation is "the last time the resolution changed from <null> to <something>".

It's not stored in the database, only the index, and it's updated/corrected on every change to the issue.

I am assuming that by "resolution status" you do mean just "resolution" - status doesn't have anything to do with this, it's separate from resolution and I just want to make sure it's clear.

To work-around this, you need to create a custom field and set it yourself when you need it to be set.

That is just what I was afraid of....thanks for your input.

Like Kari Ringo likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 11, 2013

Sorry it wasn't what you wanted to hear, but "resolution date" as implemented, is a very useful measure for many (most?) Jira users. To change the behaviour is a total pain, so I wouldn't bother, but adding a different metric is easy-ish, and far more helpful.

Like Curt Holley likes this

What if the resolution changed from <something> to <something else>> We'd expect the Resolved date to stay same, but it seems it is changing...

I am having the same issue. the thing is we are trying to use a third party time tracking app (Hubstaff) and they use the resolution date as an identifier for "active" or "inactive" issues, being active issues all with no resolution date.

Since we are using custom workflows and require resolution on certain transitions, the resolution field becomes mandatory from the creation of issues, so all our issues have a resolution date.

I strongly disagree that "resolution date as implementes is a very useful measure for many (most?) jira users", since it's not a field that can be updated and it's functioning seems completely independent from any action the user may take.

Is there a workaround for this?

Verhás István
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 02, 2018

Hi @Nic Brough (Adaptavist),

 

I accept your answer but I can not explain how the csv importer do the magic at least in JIRA version 7.x . Actually if you map a column to Resolution and another one to Date Resolved you can even update an existing issue's resolution date. What's more there is no change in the issue's history at least on the UI.

 

Regards,

Istvan

Script Runner:

import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.IssueManager
import java.sql.Timestamp
 
ComponentManager componentManager = ComponentManager.getInstance()
IssueManager issueManager = componentManager.getIssueManager()
MutableIssue myIssue = issueManager.getIssueObject("SMS-1435")

Timestamp time = new Timestamp(2013, 03, 25, 0, 44, 0, 0) 
myIssue.setResolutionDate(time)
myIssue.store()

In case someone need this to work:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.IssueManager
import java.sql.Timestamp
def issueManager = ComponentAccessor.getIssueManager()
MutableIssue myIssue = issueManager.getIssueObject("JIRA-1")
Timestamp time = new Timestamp(119,7,5,13,41,0,0)
myIssue.setResolutionDate(time)
myIssue.store()

(119,7,5,13,41,0,0) = 2019/8/5 13:41

119 = 2019 because 2019-1900 = 119 (I don't know why. So for 1999 it will be 99)

7 = august ))))) I don't know why, but 0 is january

for day and time no magic needed

I tried the below instead of using the Timestap time. It also works.

Date newdate = new Date("12/12/2019");
myIssue.setResolutionDate(newdate.toTimestamp())

Matt Doar__ LinkedIn
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 26, 2020

The issues might need a reindex after this to make searches work as expected?

Hi,
The resolveddate field has wrong date after using the above script. I used the timestamp (2017, 01, 29, 7, 0, 0, 0) for Jan 29, 2017, but after running the script, resolveddate changed to April 01, 2017. Can you verify below script and let me know if I'm using right syntax for timestamp?
 


import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.IssueManager
import java.sql.Timestamp
import com.atlassian.jira.component.ComponentAccessor
ComponentManager componentManager = ComponentManager.getInstance()
IssueManager issueManager = ComponentAccessor.getIssueManager()
MutableIssue myIssue = issueManager.getIssueObject("SMS-9165")
Timestamp time = new Timestamp(2017, 01, 29, 7, 0, 0, 0)
myIssue.setResolutionDate(time)
myIssue.store()

Suggest an answer

Log in or Sign up to answer