https://developer.atlassian.com/server/jira/platform/performing-issue-operations/ - IssueService vs issueManager
This project is a basic template that can be used to store all custom scripts created for ScriptRunner.
It provides some dependencies and one very simple example that is mentioned in the documentation.