Best way to provide a script to update comment when assignee changes ?


I look for the best way to provide a script which updates the comment in case the assignee changes.
Has anyone done something similar to provide me guidence what to do ?

As well i wonder where to find an example for an custom listener script.
What i look for ?

  • Example Class
  • Where to place the custom listener class on the server ?
  • Can you access inside the custom listener as well the current and previous values
    (issue and originalissue object) 

Is there a way to call instead of a custom listener class a listener which calls an groovy script ?


Many thanks for your help!

1 answer

Something like this. There are lot of questions on setting up listeners. Just copy the file to your script root, go to Script Listeners in the UI, new Custom listener, point to the file:


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import groovy.util.logging.Log4j

class ExampleListener extends AbstractIssueEventListener {

    void workflowEvent(IssueEvent event) {
        def commentManager = ComponentAccessor.getCommentManager()
        def assignedChanged = event.getChangeLog()?.getRelated("ChildChangeItem").any {
            it.get("field") == "assignee"
        if (assignedChanged) {


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

460 views 8 27
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