We will show an error like this in the Script registry for Listeners:
when the users refer to a property hanging off the event object because the registry does not seem to understand that the event object, in this case, is an IssueEvent which does have an issue property. So the error is not correct for the context of this listener.
This can make users think their scripts are wrong when they are not if they use the Script registry to check for errors. The listener itself will show a green tick for this script:
- Make a custom script listener that listens for the Issue Created and Issue Updated event with this code in a script file under the <ScriptRoots>/scripts/listener/my_listener_script.groovy
- Refer to the script as a file instead of inline and save the listener
- The listener will show green when checking the code
- Run the Script registry built-in script and look for the error reported for this specific listener which should be: "No such property: issue for class: java.lang.Object"
Using the script inline has the same error as well: