scriptrunner scripted field cache not updated Edited

i created a scripted field with scriptrunner which retrieves information from linked issues.

At first, it works fine, the preview is ok, but as soon as issue is updated, the result displayed in a search result becomes randomly updated. If i refresh the page, i sometimes obtain the expected result, but, sometimes, i have the old result.

I also retrieve not updated result through the JIRA rest API.

I made two full indexes refresh and the behaviour is still the same. There is obviously a cache issue but i do not know how to force refresh.

I also tried the script provided by altavist to reindex all issues containing scripted field but no effect.

1 answer

1 accepted

You can try disabling the cache by adding the following line to the start of your script:

enableCache = {-> false}

Reindex and try the search again. Although this won't help with the search.

Please see here for more details on the scripted fields cache. It's quite complicated when you are accessing data outside of the current issue or linked issues.

In our documentation we say:

"However, when you are doing a full, stop-the-world reindex, the query results are not necessarily going to be correct, as they may depend on querying on issues that have not yet been indexed."

I think this is the problem you are facing and unfortunately is the way JIRA works.

thank you for your answer,

I finally restarted the service and it resolved the problem. Maybe a periodic restart is a workaround.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

827 views 2 9
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