I am trying to change created date for an old issue using the Adaptavist scriptrunner console. I have been abnle to change summary but changes to date created don't seem to save. This is my script:
MutableIssue issue = ComponentAccessor.getIssueManager().getIssueByKeyIgnoreCase('ABC-12')
Calendar calendar = Calendar.getInstance();
ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), issue,EventDispatchOption.ISSUE_UPDATED, false)
Should this be possible or ir there another way to do it?
I don't this is going to work. I've tried it but it doesn't work that way.
As an alternate approach you can alter the value in database.
That would work fine. But why would you need to change the created date anyway.
You would need to be cautious about it.
Well in that case if it is just one single issue.
you can find that issue in database and update its created date.
You can use the following queires:
To get the issue (we need id from here)
Select id, created
where project = 1234 and issuenum = 123;
Issuenum is the actual number of the issue, for e.g. the issue key is Test_Proj-123, then the issuenum is 123.
Project is the projectid. (get it from the admin -> detail) at the end of url.
Assume we get id = 10101
Then update the issue
set CREATED = '2017-09-04 16:17:49'
where id = 10101
That wil update the created date of said issue to sept 4th and to the according time.
Hope this helps.
Why don't you simply try project import wizard? This has an ability to update multiple issues' created datetime in one go without any problem.
For that, you can create a CSV file including details like key, created and summary.
|SR-5455||20/02/17 00:00||test 1|
|SR-5672||5/4/2017 0:00||test 3|
|SR-5673||1/3/2017 0:00||test 4|
|SR-5674||9/3/2017 0:00||test 5|
Just make sure that key and summary are as per the issue.
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in talking to 20 people planning t...
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!
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