Need to fire event based on value change of custom field

Basically what I need is below

I have a custom field 'Special' with values None, A and B as drop-down option. By default the option is set as NONE. A user could change option A or B. When someone choses a value to A or B, an email needs to be send out accoridngly to a fixed email chain.

Need to send out Issue ID and Summary for the issue in the email as well as the current user who set it.

How can I accomplish this?

I tired behaviour plugin as described in this post and also used Mizan's option but think I am don't have the requisite background to code this. Apreciate any help

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
import org.apache.log4j.Category
FormField Special= getFieldById('11240')
ComponentManager componentManager = ComponentManager.getInstance()
MailServerManager mailServerManager = componentManager.getMailServerManager()
SMTPMailServer mailServer = mailServerManager.getDefaultSMTPMailServer()
if (mailServer) {
        Email email = new Email("") // Set the TO address, optionally CC and BCC
        email.setSubject("Blocking issue raised by ${issue.getReporter().getFullName()}: ${issue.summary}") // todo: check the subject value
        String content = "Construct your body here.";  //TODO: Set email's body.
else {
    log.error("No SMTP mail server defined")

1 answer

Hi Rizwan ,

Use the exact script provided by me .. use fieldChanged instead of your customfield id .

Also the script is for an older version of Jira , there are some api changes which you will need to update . eg: ComponentManager -> ComponentAccessor .

IF you use the above script then it will send an email whenever the user changes the value of the field before submiting it . I think you should use a post function , may be you can use send custom email post function by script runner plugin

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,310 views 5 11
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