JIRA can be very efficient, but out of the box not real automation exists..

If the "earlier days", the only way to do this was JellyScript - a horrible XML implementation of scripting, java wrapped in XML..

 

These days several other ways exist:

 

Atlassian CLI

Atlassian CLI - my favorite, used in Making a free JIRA Scheduler 

JellyScript

JellyScript

Groovy

Groovy - supported by the Script Runner plugin - This should be very good

REST/SOAP API

 Interfacing with JIRA through webservices