lost the import of classes in the cloud

mike tayson June 1, 2018

ScriptRunner for JIRA Cloud. can not add any import to the script

I try to add the simplest classes. like this, for example

import com.atlassian.jira.component.ComponentAccessor

and get an error

Script1.groovy: 1: unable to resolve class com.atlassian.jira.component.ComponentAccessor @ line 1, column 1. import com.atlassian.jira.component.ComponentAccessor

what the problem. any idea?

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 7, 2018

Hi Mike,

Thank you for your question.

I can confirm that ScriptRunner for Jira Cloud is different to ScriptRunner Jira Server as Jira Cloud does not provide the Java API which the server version has as Atlassian restrict what functions can be performed on cloud through the Rest API.

This is reason that your Import statement gives an error as this import statement is only valid for the Java API on Jira Server.

More information on the differences between the cloud and server versions can be found in the documentation page located here.

If this answer has solved your issue can you please accept it in order to mark this answer as correct for users who are searching for a similar issue.

Regards,

Kristian

Georges-Henry PORTEFAIT September 17, 2019

So any script with an import statement cannot work in Cloud version ? 

what a loss of power

Like # people like this
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2019

Hi George,

I can confirm that you only use imports provided by the standard Java 8 classes as described in the documentation page here and that as mentioned previously you can only interact with Jira Cloud through the Rest API as Atlassian do not provide the same Java API in Jira Cloud that they do in Jira Server.

Regards,

Kristian

RentalHost November 4, 2019

Is it possible to bulk delete custom fields using script runner?

Suggest an answer

Log in or Sign up to answer