Scripted field based on remote issue link is not being indexed reliably

Karl Wagner August 8, 2017

An issue is created via REST API then a remote issue link is added to the new issue by the same script. 

A custom field enumerates the remote issue links and gets assigned a value when the remote issue link globalId matches a pattern. The scripted field gets populated correctly, but the search index is not being updated. Consequently, any searches based on the contents of the scripted field are failing.

There is a similar script that works reliably. The only difference is that script makes other updates to the issue after the remote link has been created.

I can hack around it by doing a meaningless update, or by forcing the globalId into a regular custom field.

Are there any better ideas how to get reliable indexing?

 

1 answer

0 votes
Daniel Yelamos [Adaptavist]
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 21, 2017

Hello Karl.

If I'm correct, and I believe I am, you cannot search by a scriptedField reliably(please note my word usage). The reason why, is mainly that Scripted Fields are always evaluated when the issue is viewed.

The main issue is as follows:

Imagine that you have a simple scripted field which simply shows the date. Everytime time an issue is viewed, that field would change, so , as you open an issue, and you have to reindex. All of the time...

Imagine how heavy that would be in terms of CPU ussage in your architecture. 

The only workarounds you have about this, is, as you mentioned, do a manually reindex, or update the issue. That is why one of your scripts works, the one that does an update, and this one doesn't.

I hope this helped.

Cheers

Dyelamos

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events