Getting import error in Script runner

RentalHost November 4, 2019

I am trying to use script runner to delete custom field in bulk, but i am getting import issue for all classes in script runner.

Like Unable to import package com.atlassian.jira.issue.CustomFieldManager

Please help me how to resolve this import issue in script runner.

Thanks in advance.

4 answers

1 vote
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.
November 5, 2019

Hi White Linen Homes,

Thank you for your question.

I can confirm that the reason that your package import mentioned above will not work inside of ScriptRunner for Jira Cloud is due to the fact the imports you have mentioned are for ScriptRunner for Jira Server and this will not work as Atlassian only provide a Rest API in Jira Cloud and do not provide a Java API in the cloud like they do in Jira Server.

You can see more detailed information on the differences between the cloud and server versions inside of our documentation page located here.

We would recommend reviewing the documentation for ScriptRunner for Jira Cloud which is located here along with the Jira Cloud Rest API Documentation in order to see how the REST API's work in Jira cloud.

I have reviewed the Jira Cloud Rest API for yourself and can confirm that Atlassian does not provide any Rest API's inside of Jira Cloud to delete Custom Fields which means that it will not be possible to achieve your requirement of bulk deleting custom fields with ScriptRunenr for Jira Cloud.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,

Kristian

0 votes
RentalHost November 4, 2019

Ok - but do we need to do import packages in order to bulk delete CFs?

0 votes
RentalHost November 4, 2019

Not sure I follow.  Script runner is made for cloud also.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2019

Yes, ScriptRunner is available for cloud, but the functionality is limited compared to the server version.

One of the limitations is, that you cannot import atlassian packages, only some basic Java 8 SE classes are available.

Unfortunately, it is not possible to write the same scripts as in Jira server so far.

0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2019

Suggest an answer

Log in or Sign up to answer