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

Can I use grapes from scriptrunner?

Hi all I am trying to open an .xlsx file from a post stript using script runner.  To do this I need to include the apache poi. 

 

I  found this code online but it does not work for me.   Should I be able to call grapes from scriptrunner in the scriptrunner console?

Is there further configuration I need to do to set this up?  

Code I tried:

groovy.grape.Grape.grab(group:'org.apache.poi', module:'poi', version:'4.0')
groovy.grape.Grape.grab(group:'org.apache.poi', module:'poi-ooxml', version:'4.0')

returned: 

Error grabbing Grapes -- [unresolved dependency: org.apache.poi#poi;4.0: not found]

I also tried

@Grab('org.apache.poi:poi:4.0')
@Grab('org.apache.poi:poi-ooxml:4.0')

returned

startup failed: Script13.groovy: 2: unexpected token: @ line 2, column 38. @Grab('org.apache.poi:poi-ooxml:4.0') ^ 1 error

And:

@Grapes([
@Grab(group='org.apache.poi', module='poi', version='4.0'),
@Grab(group='org.apache.poi', module='poi-ooxml', version='4.0')
])

 

startup failed: Script17.groovy: 4: unexpected token: @ line 4, column 3. ]) ^ 1 error

 

PS I have tried many other ways to import this library I have added several questions about it.  If you can help please see my other questions

 

2 answers

I am facing the same issue,is there anyone to help me?

0 votes

Hi @OToole @Chhaya_Gadade 

I am not sure if question have been saved.

I try below code, and it works will.

@Grapes([
@Grab(group='org.apache.poi', module='poi', version='3.8'),
@Grab(group='org.apache.poi', module='poi-ooxml', version='3.8')
])
dummy = null

scriptrunner version: 6.15

 

For more information, you can refer following url.

https://stackoverflow.com/questions/5727355/why-cant-i-do-a-method-call-after-a-grab-declaration-in-a-groovy-script#5727638

Suggest an answer

Log in or Sign up to answer
TAGS

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