If I access a scripted field with a scriptrunner script the log stops working.
I thought, I could save some time and use the value of the scripted field and it is there but the logs stop working.
Can you confirm this behavior? Is this a bug?
See the following code.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import groovy.transform.BaseScript
import com.onresolve.scriptrunner.runner.customisers.ContextBaseScript
@BaseScript ContextBaseScript script
Issue issue = getIssueOrDefault('TEST-123')
final CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
final String cfName = "my scripted custom field"
CustomField cField = customFieldManager.getCustomFieldObjectsByName(cfName)?.first()
log.error("Log still works: You can see this.")
def cfValue = issue.getCustomFieldValue(cField)
log.error("Log stops working if custom field is a scripted field: You can't see this.")
log.error("Custom field value: '${cfValue}' of class '${cfValue.getClass()}'.")
return "Custom field value: '${cfValue}' of class '${cfValue.getClass()}'."
You can run this script from console. Replace "my scripted custom field" with the name of your scripted field and 'TEST-123' with an issue that has the field and an value inside.