How do I change field's rendering method via script?

Hello,
How do I change field’s rendering method via script?
I tried everything, and there is not much examples for this.
I have a field that is used in multiple field configurations. I’d like to change its rendering method in all field configurations.
My JIRA DC version is 8.20.15.
Thank you.

I’ve done this before with a ScriptRunner script. Of course, test in a staging instance

import com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem

// Change the renderer for Log Work for all field configurations
// The script may time out after about 5 minutes but continues to run on the server. 
// Have to change the default field configuration by hand
// Renderers are provided by the templatehelper plugin

    
def dryRun = true

def fieldLayoutManager = ComponentAccessor.getFieldLayoutManager()
def result = new StringBuffer()

def fieldLayouts = fieldLayoutManager.getEditableFieldLayouts()
for (fieldLayout in fieldLayouts) {
    result.append("Field Configuration: " + fieldLayout.name)
    result.append("<br>")

    def fieldName = "worklog"
    def futureRenderer = "go-jira-renderer"
    def FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(fieldName)
    def rendererType = fieldLayoutItem.getRendererType()
    if (rendererType != futureRenderer) {
	result.append("- Changing the field ''" + fieldName + "'' renderer from " + rendererType + " to " + futureRenderer)
	result.append("<br>")
	if (!dryRun) {
	    fieldLayout.setRendererType(fieldLayoutItem, futureRenderer)
	    fieldLayoutManager.storeEditableFieldLayout(fieldLayout)
        }
    }

}

return result.toString()