For this recipe, we need to have the ScriptRunner for Jira app installed. You can download it from the following link, or install it directly using the UPM: https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner.
You might also want to get familiar with Groovy scripting (http://groovy.codehaus.org).