Custom field update notification in Jira?

Jenin CM July 16, 2013

Hi All

Is there a plugin which allows us to set notifications/alerts whenever a said custom field is updated in a Jira issue?

Is there a way we could achieve this in Jira?

Thanks and Regards,

Jenin C M

4 answers

1 accepted

0 votes
Answer accepted
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

then you can write listener(you van write using groovey script runner plugin) and implement you login on issue update event

for your reference, sample code will be something like

public void issueUpdated(IssueEvent event)
{
    ComponentManager componentManager = ComponentManager.getInstance()
    MutableIssue issue = componentManager.getIssueManager().getIssueObject(event.getIssue().getLong("id"))
    VersionManager versionManager = componentManager.getVersionManager()
    IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
 
    try
    {
        List changeItems = event.getChangeLog().getRelated("ChildChangeItem");
        Iterator iter = changeItems.iterator();
        while (iter.hasNext())
        {
            GenericValue changeItem = (GenericValue) iter.next();
            if ( changeItem.get("field") == "Found in Version")
            {               
                issue.setAffectedVersions([versionManager.getVersion(issue.getGenericValue().project, changeItem.get("newstring"))]);               
            }
            if ( changeItem.get("field") == "Target Version" )
            {              
                issue.setFixVersions([versionManager.getVersion(issue.getGenericValue().project, changeItem.get("newstring"))]);               
            }
        }
        Map actionParams = EasyMap.build("issue", issue.getGenericValue(), "issueObject", issue, "remoteUser", issue.getAssignee(), "dispatchEvent", Boolean.TRUE)
        ActionResult aResult = CoreFactory.getActionDispatcher().execute(ActionNames.ISSUE_UPDATE, actionParams)
    }
    catch (GenericEntityException e)
    {
        log("Error: "+e);
    }
}

just you need to modify the above code as per your requirement


1 vote
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

using issue update event on notification scheme you can send notifications/alerts

check this doc

https://confluence.atlassian.com/display/JIRA/Creating+a+Notification+Scheme

or

you can write a listener and can send notifications from Issue Update event

0 votes
Vladimir Horev _Raley_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2016

Jenin, Jan

Please check out our add-on https://marketplace.atlassian.com/plugins/net.vacom.jirassimo/server/overview 

You can precisely configure it to fire notifications only on specific field being changed

Cheers,

Vladimir

0 votes
Jenin CM July 16, 2013

Hi Ram,

Thanks for the response!

But my requirement is different here, I need to get a notification when a specific custom field is updated but not for rest of the fields. Its like setting an alert for a specific custom field.

Regards,

Jenin C M

Jan Kochanowicz November 23, 2014

I have the same problem. Did you find a solution?

Like Flash_Sheridan likes this
Nour Durra June 16, 2016

I have this exact problem, anyone found a solution?

Like Flash_Sheridan likes this
Sivan Samira March 1, 2017

anyone find a solution? i'm having the same problem

Like Flash_Sheridan likes this
Sean Keating March 3, 2017

I have been able to accomplish this using this add-on: https://marketplace.atlassian.com/plugins/com.metainf.jira.plugin.emailissue/server/overview

It allows you to send an email notification on issue update, but to filter it to only cases when a specific custom field changes. So updates to any other fields do not result in a notification.

Vladimir Horev _Raley_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 6, 2017

Jenin, you can specify a condition in Raley Email Notifications messenger template like this:

#foreach ($issue in $issues)

   #foreach ($item in $issue.lastchange.items)

      #if ($item.field = 'YOURCUSTOMFIELDNAME')

          Hi there, issue $issue.key was updated. The new value for customfield is $item.toString.

      #end

   #end

#end

 

Hope this helps,

Vladimir

Suggest an answer

Log in or Sign up to answer