I am trying to execute the same reindex script that I am able to run through Run Scripts but in the Workflow transiton in a Post Function.
I had a Groovy post-function that transitions linked issues. After transitioning a linked issue:
WorkflowUtils.actionIssue("", linkedIssue, TRANSITIONID, currentUser, [:])
I tried the usual reindex-an-issue code:
boolean wasIndexing = ImportUtils.isIndexIssues(); ImportUtils.setIndexIssues(true); indexManager.reIndex(linkedIssue) ImportUtils.setIndexIssues(wasIndexing);
But it didn't work.
Digging through FasttrackTransition.groovy source, I found that my 'linkedIssue' object that I transitioned had stale data, particularly the status. I had re-retrieve the Issue object, and then reindex that:
linkedIssue = componentManager.getIssueManager().getIssueObject(linkedIssue.id)
boolean wasIndexing = ImportUtils.isIndexIssues(); ImportUtils.setIndexIssues(true); indexManager.reIndex(linkedIssue) ImportUtils.setIndexIssues(wasIndexing);
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.