Good day,
I try to prepare groovy script to realize logic before export with Better Excel Exporter.
I need to read value from project custom field (projectrak/profields app) and with scriptrunner I make it this way
import com.deiser.jira.profields.api.field.FieldService
import com.deiser.jira.profields.api.field.list.ListField
import com.deiser.jira.profields.api.value.ValueService
@WithPlugin("com.deiser.jira.profields")
def valueService = ComponentAccessor.getOSGiComponentInstanceOfType(ValueService.class)
def fieldService = ComponentAccessor.getOSGiComponentInstanceOfType(FieldService.class)
ListField field = fieldService.get("Included in the week reports").get(0)
def fieldValue = valueService.getValue(project, field)
But groovy in Better Excel Exporter dont have this features of scriptrunner and I try to make it with dynamic class loading this way
in class constructor I make loading of classes
valueServiceClass=ComponentAccessor.pluginAccessor.classLoader.loadClass("com.deiser.jira.profields.api.field.FieldService")
fieldServiceClass=ComponentAccessor.pluginAccessor.classLoader.loadClass("com.deiser.jira.profields.api.value.ValueService")
listFieldClass=ComponentAccessor.pluginAccessor.classLoader.loadClass("com.deiser.jira.profields.api.field.list.ListField")
valueService=ComponentAccessor.getOSGiComponentInstanceOfType(valueServiceClass) fieldService=ComponentAccessor.getOSGiComponentInstanceOfType(fieldServiceClass) listField=ComponentAccessor.getOSGiComponentInstanceOfType(listFieldClass)
But with log I see that listFieldClass= interface com.deiser.jira.profields.api.field.list.ListField
and listField=null (looks that is not right)
and then in function I want to make read of field value like this
def field = this.listField.newInstance()
field = this.fieldService.get("Included in the week reports").get(0)
def fieldValue = this.valueService.getValue(project, field)
But script doesn't go through line with def field = this.listField.newInstance()
In logs I don't see exact groovy error message, only messages of fail render from Better Excel Export app. And I don't have experience yet with dynamic class loading so maybe I just failed with code logic
I'm Fede Baronti from DEISER. Thanks for submitting your question in the community.
Since you've also reported a support request we'll communicate with you through that channel.
Thanks again and best regards,
Fede.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.