Not sure I’m using the listener correctly, but I have a calculated field which I’m using Behaviours to set to ReadOnly, and then when some other fields calculate a value I update that field using ScriptRunner Script Listener.
I calculate the newValue, then in the listener use this method to set the custom field with the new value. (in this example I’ve replaced the field ID with XXXXX)
My Issue: When I do this, and I’m looking at the Jira Cloud screen - it works in the back end, but I have to hit F5 or refresh the issue screen and see the new value - it doesn’t update the custom field automatically… even if I wait a while? How can I force that field, or the screen to refresh after setting the field??
//do not attempt to update the result if it is the same as the existing one.
if(newValue == currentValue) {
logger.info("The New value was the same as the existing one, no update needed.")
} else {
//Set field
eventIssue.update{
setCustomFieldValue(XXXXX, newValue)}
Are you using a Scripted Field? I believe this is a known limitation with ScriptRunner's Scripted Fields feature:
Source: https://docs.adaptavist.com/sr4jc/latest/features/scripted-fields
If so, basically you'll either have to reload the page, or maybe (based on the wording from the screenshot) force the issue to update in some way AFTER the field is calculated?
Someone from Adaptavist might have a better answer for you tho. @Nic Brough -Adaptavist-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.