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

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

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.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


182 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you