This Documentation for using ScriptRunner 3rd Party extension for Automation for Jira clearly states the following:
Additionally there are two utility functions available for writing information and error messages to the Automation for Jira audit log. They are addMessage(String message) and addError(String errorMessage)
However, when adding either to the script, I get an error 'Cannot find matching method'.
Do I need to import any packages to get this to work? If so, what package(s) do I need to import?
What version of Scriptrunner are you using?
I see that in version 6.4.0 you have a different method to add error message:
errorCollection.addErrorMessage("Something went wrong")
There are two *actions* available for for A4J as of the most recent ScriptRunner version - https://scriptrunner.adaptavist.com/latest/jira/releases/release-notes-6.x.html#_new_scriptrunner_action_for_automation_for_jira.
Please can you confirm you are using the *new* action... the old one has "deprecated" in the name.
The addMessage and addError are only available in the new action.
A screenshot might be helpful.
Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events