Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Few issues in Groovy scripts Project

Piyal Nanayakkara May 10, 2019

Hi

I have several Groovy scripts and I created a Groovy Project in IntelliJ IDEA (version 14) and I have below statement in most of the Groovy Scripts.

import com.atlassian.jira.component.ComponentAccessor

But the IntelliJ IDEA's intellisense shows the message " Cannot resolve symbol 'atlassian' "

I have configured Groovy for this project and using "Groovy-Eclipse" compiler under Settings >>Build, Execution, Deployment >> Compiler >> Java Compiler

Appreciate if you could let me know who to fix this?

Additionally when I try to build the project, I see below error in the "Messages Make" window :

Information:5/10/2019 2:04 PM - Compilation completed with 1 error and 0 warnings in 637ms

Error:java.lang.StringIndexOutOfBoundsException: String index out of range: 28

 

When I click on the Error statement, it doesnt point to any code line of groovy script.

Please help me to fix it too.

Regard

Piyal

1 answer

1 accepted

1 vote
Answer accepted
Tarun Sapra
Community Champion
May 10, 2019

Hello @Piyal Nanayakkara 

The error is coming because you need to have Atlassian java libraries in your classpath. Because the jar files are not on your class-path thus you see this error.

Tarun Sapra
Community Champion
May 10, 2019

If you are writing groovy for scripts for script runner plugin then follow this setup

https://scriptrunner.adaptavist.com/5.5.5/jira/DevEnvironment.html

Piyal Nanayakkara May 28, 2019

Thanks Tarun

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events