I have a scriptrunner automation script that adds an email address(extracted from ticket description) to a customField. This script will be triggered(through project automation) when creating a new ticket. I have used the the utility functions available for writing information and error messages to the Automation for Jira audit log- addMessage(String message) and addError(String errorMessage). Here is the link to documentation:
https://scriptrunner.adaptavist.com/latest/jira/plugins/automation-for-jira.html
I have a built-in test runner script to test the above scriptrunner automation script. I have followed the documentation from this link : https://scriptrunner.adaptavist.com/latest/jira/testing.html
When I run the built-in test runner script, I get the below exception :
groovy.lang.MissingMethodException:
No signature of method: automationScriptName.addMessage() is applicable for argument types: (String) values: [XXXX].
If I comment the addMessage(String message) line on the automation script, the groovy.lang.MissingMethodException does not occur and my test will pass. Commenting those line is the temporary workaround that I have.
Wondering why the utility functions - addMessage(String message) and addError(String errorMessage) not supported when the script is called from the test runner framework ?
Any insight on this issue is greatly appreciated.
Thanks,
Anita Kalidoss