How can I update a custom field when Assign to me button is click


I am using JIRA 6.0.6 and would like to update a custom field on a step when Assign to me button has been clicked. Is there a way I can acheive that. I know that adding a Listener might help but I can't seem to find any sample code.

Thanks for you help in advance.


3 answers

Hi Anand,

Its a sample you are looking for

public class MyListenerClass  implements InitializingBean,DisposableBean 
	public void afterPropertiesSet() throws Exception 
	public void destroy() throws Exception 
	public void onIssueEvent(IssueEvent issueEvent) 
			// do stuff


You could use script runner and create a listener on the Issue Assigned event.

And then just set the custom field over some groovy script.

here is an example:

package com.custom

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.util.ImportUtils
import org.apache.log4j.Category

class MyCustomListener extends AbstractIssueEventListener {
    Category log = Category.getInstance(MyCustomListener .class)

    MyCustomListener () {

    void issueAssigned(IssueEvent event) {
        log.debug "${event.getEventTypeId()} EVENT on ${event.issue}:"

        Issue issue = event.issue


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 ...

3,282 views 14 20
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