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 votes
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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,950 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot