Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Dynamic class loading from apps API Edited

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

 

1 answer

Hi @Alexander Raymukanov ,

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

494 views 6 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you