I am trying to get value from a profields custom field but the code is not working.
Versión:7.7.1
Proveedor:DEISER
Clave de la aplicación:com.deiser.jira.profields
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.deiser.jira.profields.api.field.status.StatusField
import com.deiser.jira.profields.api.field.FieldService
import com.deiser.jira.profields.api.field.Field
import com.deiser.jira.profields.api.value.ValueService
@WithPlugin("com.deiser.jira.profields")
// Project key
pkey = XXXX
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKeyIgnoreCase(pkey)
def fieldService = ComponentAccessor.getOSGiComponentInstanceOfType(FieldService.class)
Field statusField = (StatusField) fieldService.get(25)
def statusValue = profieldsFieldService.getValue(project, (StatusField) statusField)
The log error is following.
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.deiser.jira.profields.impl.field.type.generalfield.GeneralFieldImpl@6e5379a' with class 'com.deiser.jira.profields.impl.field.type.generalfield.GeneralFieldImpl' to class 'com.deiser.jira.profields.api.field.status.StatusField' at Script2600$_buildHTMLTableOfIssues_closure1$_closure4$_closure5$_closure7$_closure8.doCall(Script2600.groovy:221) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4$_closure5$_closure7$_closure8.doCall(Script2600.groovy) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4$_closure5$_closure7.doCall(Script2600.groovy:152) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4$_closure5.doCall(Script2600.groovy:151) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4$_closure5.doCall(Script2600.groovy) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4.doCall(Script2600.groovy:138) at Script2600$_buildHTMLTableOfIssues_closure1$_closure4.doCall(Script2600.groovy) at Script2600$_buildHTMLTableOfIssues_closure1.doCall(Script2600.groovy:136) at Script2600$_buildHTMLTableOfIssues_closure1.doCall(Script2600.groovy) at Script2600.buildHTMLTableOfIssues(Script2600.groovy:119) at Script2600$buildHTMLTableOfIssues$0.callStatic(Unknown Source) at Script2600.run(Script2600.groovy:71)