Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sometimes re-index does not work

Stefan Stadler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 12, 2024

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)

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Champion
February 23, 2025

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

Stefan Stadler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 23, 2025

Hi Fabio,

yes, as you can see this is the exact same code as you are using.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.1
TAGS
AUG Leaders

Atlassian Community Events