I am trying to retrieve the value of a scripted field from a linked issue in a listener to be run when an issue is updated. I only need to read it, use it in a calculation and then update another field so I shouldn't be at risk of getting stuck in an infinite loop or something.
Here is the section that seems to be causing me problems.
def scriptField = customFieldManager.getCustomFieldObjectByName("scriptFieldName")
def scriptFieldValue = linkedIssue.getCustomFieldValue(scriptField)
I can confirm that this works if I replace the name of the field with the name of a normal custom text field but as soon as I change it to a scripted field it won't retrieve the field value.
I assume this means that there is either another way to retrieve scripted fields in listeners or I'm trying to do something that can't be done.
Any help you can give me would be great.