Jira does not refresh a scripted custom field even when the links to calculate this scripted field have been modified. It seems that when you clone an issue with a scripted custom field, you can not modify it. So my question is how do you modify a scripted field on on a Jira issue? Do you use REST API or write a groovy script to modify it?
Disable the caching on the scripted field. This is basically required when scripting a field that 'talks' to linked issues.
https://scriptrunner.adaptavist.com/latest/jira/scripted-fields.html#_more_advanced_notes_on_caching
enableCache = {-> false}
I have added the above value but it still doesnt work. Any other way to make it work?It displays old value and only gets refreshed after updating the request
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Do you mean Scriptrunner Scripted Field? If so, then Scripted Fields do not store any value. There is a script inside the field which produces a value. I guess you need to change the script. Go to cog item->add-ons->scripted fields. Then find your field and choose edit. You will be able to change the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it helps, there's an oversimplified way to think of it.
The fields are read-only because they are calculated, not entered. A scripted field's data is updated when the issue the field belongs to is re-indexed for any reason.
You can't modify the values of a scripted field because they don't really exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nic, I forget, does the value of a scripted field usually depend on the cached data for the issue or what is in the Lucene index? I think it might be the former
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mostly the cached value. It sees the Lucene index as the "source of truth", but in most cases looks for the cached value before reading the index.
(This is a lot of the reason I say "oversimplified" when I say "scripted fields are calculated when indexing")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.