Hi all,
I am running a bunch of listeners, where different kind of automations happen.
One common example is, that after updating a custom field, there will be further updates depending on what has been updated. Those happen in the listener and at the end, the script performs an update.
Unfortunately, it appears that this index is not always working.
We have seen several times, that the index had to be run manually afterwards for the related issues to appear in the JQL results.
I am using the following code for indexing and I am not sure, what is missing that causes this behaviour. Can you let me know, why indexing is sometimes not working and sometimes works like a charm?
Thanks!
IssueIndexingService indexing = ComponentAccessor.getComponent(IssueIndexingService)
boolean wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true)
indexing.reIndex(issue)
// This is only for logging. I could therefore confirm that the indexing really has been running.
//jLog.debug(step, "Reindexed issue ${issue}. System was indexing: $wasIndexing")
ImportUtils.setIndexIssues(wasIndexing)
Hi @Stefan Stadler ,
I have several script that need reindexing and on my side I use just IssueIndexingService
IssueIndexingService indexing = ComponentAccessor.getComponent(IssueIndexingService)
indexing.reIndex(issue);
Did u try this code only?
Let me know,
Fabio
Hi Fabio,
yes, as you can see this is the exact same code as you are using.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.