we have a problem where after creating linked issues in a groovy script with createIssueLink() and running a JQL query, the latter returns inconsistent results as if the linked issues weren’t reindexed yet.
Regarding the createIssueLink() in Jira documentation it says "Constructs a new issuelink from the sourceIssueId to the destinationId and persists it. This operation will cause a re-index of the associated
The documentation is unclear whether the createIssueLink method blocks until the reindex is performed or not, in any case running a JQL query immediately after a createIssueLink which deals with the created issues links, returns an out-of-date result.
PS: reindexing with:
boolean wasIndexing = ImportUtils.isIndexIssues();
issueLinkManager.createIssueLink(fromIssue.getId(), toIssue.getId(), Long.parseLong(linkId),
didn't work for me.
Thanks in advance,
Could I have a look at your full script? I have just tested this locally and I can assure you that on my instance, createIssueLink triggered a reindex.
Could you also add your JIRA version?
To further my point, there was a feature to request that createIssueLink could opt out of the reindexing event, and it was denied.
You can read more about this here: