Is there a way to modify the create time of an issue

xuhai zhao August 13, 2012

I want to change the create time of an issue through programming. I have found that the update and create operation of an issue both need the help of "IssueInputParametersImpl" class, but this class could not set the create/update time.

So is there a way to modify the create time of an issue through programming?

Thanks

3 answers

0 votes
Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 14, 2012

I too suggest to edit DB. My answer got deleted by mistake.

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.
August 14, 2012

If editing the database, you must - stop jira, get a backup, prove it works by restoring it and testing it on a dev/test system, run your SQL, start Jira, reindex and then I recommend the integrity checker too, just in case. Having said that, hacking a handful of create-dates is not going to be a huge risk, as it's a simple attribute.

Your code doesn't include reindexing though - I suspect that might be why your data is being seen as wrong.

xuhai zhao August 15, 2012

Yes, just as you said, the copied Create Time has some small deviation: the date is right but the hour is not using this way:

"issue.setCreated(getOriginalCreateTimeStamp());

issue.store();"

Thanks for your detailed description about how to operate the database, I will have a try.

0 votes
Renjith Pillai
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.
August 14, 2012

I guess you can't.

I had seen a answer from Vishnu saying to edit the DB, but that answered has disappeared here. I guess that is the only option, but it can break JIRA if not done correctly. Search for the same in this site and you will get atleast 10 answers from @Nic warning about the same.

What is the usecase, can you explain it please?

xuhai zhao August 14, 2012

Thank you for your concern.

There is a plugin that can copy an issue from a JIRA instance to another one. But the create time could not be copied. So I want to modified it.

I have used this way to achieve this function:

MutableIssue issue = getCreatedIssue();

issue.setCreated(getOriginalCreateTimeStamp());

issue.store();// this is essential or the timestamp could not be stored.

0 votes
Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 13, 2012

You should edit the DB.

Suggest an answer

Log in or Sign up to answer