Forums

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

Jira Script plugin packages: com.atlassian.jira.bc and com.atlassian.jira.component

Yacob Hassidim February 7, 2018

Hello,

I installed the Intellij IDEA and try to debug a script.

The script imports the following Jira packages:

com.atlassian.jira.bc
com.atlassian.jira.component
com.atlassian.jira.user

Can anyone advise how to download these packages?

Thanks.

Yacob Hassidim.

 

 

1 answer

0 votes
Gareth Cantrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

Hi Yacob,

For IntelliJ you can add the jira-api.<version>.jar file to your project libraries.

You can find this in the Jira installation folder at <JIRA_HOME>/atlassian-jira/WEB-INF/lib

Yacob Hassidim February 7, 2018

Hello,

Thank you.

I added it to Global Libraries and the "import" classes were succeeded.

As you understand I am beginner on Jira script.

Can you please help me for another issue?

I try to run (debug) the script from Intellij and each Jira API failed.

For example the following API:

def searchRequestService = ComponentAccessor.getComponent(SearchRequestService.class)

Ended with the following error message:

    Caught: java.lang.NoClassDefFoundError: com/atlassian/plugin/PluginAccessor

Can you please advise?

Thanks again.

Yacob Hassidim.

Gareth Cantrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

You cannot debug or run your scripts outside of Jira. These can only be executed inside a running Jira application in order to access the running components exposed by the application.

Yacob Hassidim February 7, 2018

Hello Gareth,

Thank you.

Do you mean I must to install the ScripRunner to use  Groovy script?

Yacob Hassidim.

Gareth Cantrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

Yes, you will need to have ScriptRunner installed in order to run Groovy scripts within Jira. 

=EDIT=

If you want to script outside of Jira, you can use Jira's REST API to get the data, however, you will not be able to use the Java API in this case.

Yacob Hassidim February 7, 2018

Thank you for your help.

Yacob Hassidim.

Yacob Hassidim February 12, 2018

Hello Gareth,

Thank you for your edit about REST API.

Can you please advise me more about REST API and if you can send me a little Groovy script with REST API that access to Jira?

Yacob Hassidim.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events