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.

Cheers

Dyelamos

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

53 views 0 3
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