How to execute custom script when creating release in Jira?

I want to automatically run my own server script whenever someone clicks the release button in Jira. I don’t want to set up something heavy like Jenkins or other CI tools. I just need to execute a basic script when a release gets created.

I tried searching through Jira documentation and found some old info about event listeners in previous versions, but I can’t find anything similar for the current Jira version I’m using.

Is there a way to hook into the release creation event and trigger my custom script? What would be the best approach for this kind of automation in modern Jira versions?

Webhooks are your best bet here. I set up something similar six months back and Jira’s webhook feature works great for triggering external scripts - no heavy CI setup needed. Go to System settings > Webhooks in Jira. Configure it to fire on version events and point it at a lightweight HTTP endpoint on your server. I just used a simple Python Flask app that catches the webhook and runs my deployment script. The payload has everything you need - version name, project info, who triggered it. Watch out though - webhook delivery isn’t guaranteed. Add some basic retry logic or at least logging so you know if your script actually ran. Been rock solid for us, way simpler than spinning up Jenkins just to run scripts.

Had this exact problem last year when we needed custom notification scripts for releases. Used Jira’s Scriptrunner plugin - lets you create event listeners right in Jira. The plugin has built-in listeners for version creation and you can write Groovy scripts that run server-side or hit external endpoints. Way cleaner than managing external webhook endpoints since it all stays in your Jira instance. Groovy’s not hard to pick up if you’ve done any programming. Price is fair for smaller teams and the docs cover version events well. One heads up - keep your script execution under their timeout limits or it’ll fail silently.

jiras own automations might do the trick! just head to project settings, then automation rules, and look for triggers tied to version events. they can call rest apis or perform simple actions. they aren’t as flexible as webhooks but def easier to get going if your script runs via api.