1. Go to JIRA > System > Advanced > Services
    1. Name: “HelloService” for example
    2. Class (always):  com.onresolve.jira.groovy.GroovyService
    3. Delay (n): in minutes
    4. input-file: {JIRA_HOME}/scripts/example/HelloService.groovy
  2. Then copy the script content to this path  {JIRA_HOME}/scripts/example/HelloService.groovy

import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.customfields.CustomFieldType
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
import org.apache.log4j.Category
 
Category log = Category.getInstance("com.onresolve.jira.groovy")
log.setLevel(org.apache.log4j.Level.DEBUG)
log.debug "HELLO IM A NEW SERVICE!"

Then every n minutes you can see in the “atlassian-jira.log” the traces:
2015-05-22 13:37:13,152 atlassian-scheduler-quartz1.clustered_Worker-1 INFO ServiceRunner HelloService [onresolve.jira.groovy.GroovyService] groovyService.run
2015-05-22 13:37:13,157 atlassian-scheduler-quartz1.clustered_Worker-1 DEBUG ServiceRunner HelloService [com.onresolve.jira.groovy] HELLO IM A NEW SERVICE!

Posted by:.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s