Behaviours Plugin cannot resolve imports


I'm trying to adapt a groovy post function script to a Behaviours script. My post function script works without any problems, however, when I try to adapt it to a Behaviours script, I'm getting errors that the following classes can't be resolved:


Compilation failure: startup failed: Script1.groovy: 19: unable to resolve class com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItem @ line 19, column 1. import com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItem ^ Script1.groovy: 20: unable to resolve class com.atlassian.jira.issue.fields.screen.FieldScreenRenderer @ line 20, column 1. import com.atlassian.jira.issue.fields.screen.FieldScreenRenderer ^ Script1.groovy: 18: unable to resolve class com.atlassian.jira.issue.operation.IssueOperations @ line 18, column 1. import com.atlassian.jira.issue.operation.IssueOperations ^ Script1.groovy: 21: unable to resolve class com.atlassian.jira.issue.fields.screen.FieldScreenRendererFactory @ line 21, column 1. import com.atlassian.jira.issue.fields.screen.FieldScreenRendererFactory ^ 4 errors

I need the four classes in order to programmatically get all fields on the creation screen in order to prefill them.

Based on the advice in this question,, I asked our admin to add the packages to Import-Package section in the atlassian-plugin.xml but he had no luck:

I’ve tried several variations, but no change allowed Jira to load the plug-in. The error message is usually something like this:

2014-08-08 09:30:46,555 localhost-startStop-1 ERROR [atlassian.plugin.loaders.ScanningPluginLoader] Unable to deploy plugin 'com.onresolve.jira.groovy.groovyrunner' from 'Unit: C:\data\plugins\installed-plugins\plugin_1653577282920400456_groovyrunner-3.0.1.jar (1407514983584)'.

2014-08-08 09:30:46,555 localhost-startStop-1 ERROR [atlassian.plugin.loaders.ScanningPluginLoader] Because of the following exception:

com.atlassian.plugin.util.validation.ValidationException: The key is required: <bundle-instructions> <Import-Package>com.atlassian.jira.issue.operation.IssueOperations, com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItem, com.atlassian.jira.issue.fields.screen.FieldScreenRenderer, com.atlassian.jira.issue.fields.screen.FieldScreenRendererFactory</Import-Package></bundle-instructions>

Could anyone please help me with this or point me in the right direction? I'm using: Jira 6.2.7 ScriptRunner 3.0.1.



1 answer

Hi @Linh Tran,

Any luck in getting this solved. We are facing same issue.

Please share your approach for the above mentioned issue in order to solve this.





Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

457 views 8 27
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you