After upgrading to JIRA v8.20.6 and Script Runner 6.46.0 I'm receiving the following error message at workflow post function:
import com.atlassian.jira.issue.CustomFieldManager
def customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField Contractor = customFieldManager.getCustomFieldObject("customfield_18102")
Static type checking: Cannot find matching method java.lang.Object#getCustomFieldObject(java.lang.String)
Before the upgrade it worked.
Please help to resolve.
Thanks
Hey,
I'm an engineer from the ScriptRunner development team, I just tried pasting the following code into the script console
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
def customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField Contractor = customFieldManager.getCustomFieldObject("customfield_18102")
I do not see any errors in the editor for that code on the latest version of ScriptRunner, can you try upgrading to the latest version and see if that remedies the problem?
If it does not, then please get in touch with customer support so we can take a deeper look.
Cheers!
Reece
Hi
Can you try ?
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField Contractor = customFieldManager.getCustomFieldObject("customfield_18102")
There is an error but the script is working fine or not ?
I think the editor is not able to determine which object is returned by getCustomFieldManager. Adding the type should resolve it.
Regards
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.