Send email on asignee change

Hey guys,

I've got a configuration query, which hopefully someone is able to answer!

It seems that in the latest version of JIRA, in-line editing is considered an "issue update". E.G., if you change the asignee via in-line editing, it will not register as an "issue assign" task, where it normally would email both the current and the last asignee.

We've disabled email on issue update due to the stupendous amount of emails that we received every time the ticket was created, issue type changed, priority changed, etc etc etc.

I was wondering if anybody had a script for a listener so that it can listen for an inline assign task, and email both the current and the last assignee that the ticket has been modified (just as if you clicked the "assign" button).


Thank you in advance

1 answer

1 accepted

1 vote
Accepted answer
Henning Tietgens Community Champion Sep 17, 2013

You can use the Script Runner plugin and a script listener like this.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.event.issue.IssueEventManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.ApplicationUsers
import org.apache.log4j.Logger

import static com.atlassian.jira.event.type.EventType.ISSUE_ASSIGNED_ID

class AssigneeListener extends AbstractIssueEventListener {
    Logger myLog = Logger.getLogger(AssigneeListener.class)
    IssueEventManager issueEventManager = ComponentAccessor.getIssueEventManager()

    void workflowEvent(IssueEvent event) {
		// only one central way...
    void customEvent(IssueEvent event) {
        // If the assignee was changed...
        if (event?.changeLog?.getRelated('ChildChangeItem')?.any{ it.field=='assignee' }) {                         
            myLog.debug "Assignee was changed, triggering ISSUE ASSIGNED event."
            ApplicationUser user = ComponentAccessor.jiraAuthenticationContext.getUser()
            issueEventManager.dispatchEvent(ISSUE_ASSIGNED_ID, event.issue, ApplicationUsers.toDirectoryUser(user), true)

The code is for JIRA 6 and not tested, so please test on a test system first. See for installation instructions for custom groovy listener.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,523 views 15 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you