I am using JIRA 7.3.6 and Adaptavist scriptrunner 5.4.28
I have a Groovy Listener that changes a custom field value when either issueCreated or issueUpdated events happen. The field is being updated but a JQL search using that field does not give the correct results until the database is re-indexed.
log.debug "Updating Train field."
CustomFieldManager cfm = ComponentAccessor.getCustomFieldManager()
def relTrainField = cfm.getCustomFieldObjects(issue).find {it.name == "ReleaseTrain"}
def changeHolderTrain = new DefaultIssueChangeHolder();
relTrainField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(relTrainField), newRT),changeHolderTrain);
Is there a better way to do this custom field change that will re-index the issue also?
Most examples that I can find for re-indexing use IssueIndexManager or IssueIndexService. When I try to use those, I get errors as if those have been deprecated. Is there a way to re-index an issue using the 7.3.6 API?
Thanks for any help