Status: To Do
Affects Version/s: 6.18.0
Fix Version/s: None
Component/s: Script Editor
Code completions are failing in the Script Editor when users hit "CTRL+SPACE" to reference nested classes in their custom scripts.
- Follow the instructions in our Script Roots "Concepts" documentation to create two scripts – one of which imports a utility Class from another file. Your Script Editor file tree should look like this:
- Add a nested class to util/Bollo.groovy (see: Bollo.groovy), then hit "CTRL+SPACE" to use autocomplete.
- Here autocomplete doesn't work. No error dialog or error in jira log is produced.
- Add another class in util/Bollo.groovy outside of the Bollo class scope.
- Here autocomplete doesn't work as long as InnerClass exists. If InnerClass is removed, autocomplete starts working. No error dialog or error in jira log is produced.
- In foo.groovy (see: foo.groovy) try to use autocomplete to call the nested method inside of Bollo's NestedClass.
- Observe the popup with the error message "ScriptRunner: Error fetching completions".
- All character entries after this point generate another error (see: AutocompleteScriptEditorErrors.mov).
- Create a new class and method inside of foo.groovy and try to use autocomplete inside of the method.
- Here autocomplete doesn't work and a popup with the message "ScriptRunner: Error fetching completions." appear.
- In the Jira log there is a stack trace at the same time.
Script Editor should allow users to use Groovy's code autocompletion when using custom scripts with nested classes.
As described above, autocomplete doesn't work in the Script Editor when nested classes are present. This causes the Script Editor to generate errors in the UI and in the atlassian-jira.log: