Im trying to update change history in Script Runner->Script Console like this:
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("key")
def changeItems = changeHistoryManager.getChangeItemsForField(issue, "fieldname")
def issueManager = ComponentAccessor.getIssueManager();
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false);
In logs i see new date after setCreated but when i check history in issue it's still the same.
I misunderstood your question initially I think.
If you're trying to change the "created date" of the issue, I'm afraid this isn't possible via scriptrunner. You'll have to update this via the database.
I could be wrong here, but I don't think Jira allows the modification, so the database would be the only option.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events