Automation for Jira (Data Center) version 7.2.1 - Some functions not recognized when using ScriptRunner third party extension

This documentation 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?

duplicate of https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Automation-for-Jira-DC-v7-2-1-Help-needed-for-using-ScriptRunner/qaq-p/1563398?utm_campaign=immediate_general_question&utm_content=topic&utm_medium=email&utm_source=atlcomm#U1569369, let’s keep the conversation there.