Hello everyone!
Im trying to update change history in Script Runner->Script Console like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean
import java.sql.Timestamp
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.index.IssueIndexingService
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)
log.warn changeItems.get(1).getCreated();
changeItems.get(1).setCreated(new Timestamp(1576655013000))
log.warn changeItems.get(1).getCreated();
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false);
issueIndexingService.reIndex(issue)
In logs i see new date after setCreated but when i check history in issue it's still the same.
Thanks.