Behaviours Plugin cannot resolve imports

Hello,

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:

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

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, https://answers.atlassian.com/questions/21421/behaviours-plugin-groovy-scripts-unable-to-resolve-class-com-atlassian-jira-issue-context-projectcontext, 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.

Thanks,

Linh

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.

 

Thanks,

vikash

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 10, 2018 in Marketplace Apps

Learn about how Stefan K. built one of the *first ever* Marketplace apps

In this post you will discover more about the evolution of K15t software, some big topics they're currently focusing on in the app space, and a rare (not not funny!) photo of founders Mike Cannon-Bro...

12,565 views 11 24
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