If you want scripts that run "inside" your Jira Cloud instance you would need an ad-on.
Other external options would include creating your own add-on or using the REST API. Your own cloud add-on means hosting it on the internet. The REST API can run anywhere, including your own PC, but it cannot be triggered by actions that take place inside Jira.
Check out the following for more info, https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302
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