Notification for a custom user picker field change

Kathy Tempesta May 14, 2013

I have a custom user picker field for Tester and I want to send a notification to the person in that field when it is added for the first time or changed. Since there's no specific workflow event associated with the change (I don't want to spam them using Issue Updated) I'm wondering if there's a way to do this. I'm an administrator not a developer so I would prefer a solution that didn't involve scripting. Is it possible?

Thanks,

Kathy

4 answers

0 votes
Kathy Tempesta May 21, 2013

Today I discovered there are Listeners and then there are Script Listeners. Since I wasn't getting anywhere with plain vanilla Listeners, I decided to give Script Listeners a try. I added a new one on Issue Updated with this condition:

changeItems.any {

it.get('field') == cfValues['Tester']

}

I cobbled that together from a couple of examples. Sadly it isn't working.

Does ayone know the correct syntax capture a change in a custom field?

0 votes
Udo Brand
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.
May 14, 2013

You could create transitions (each from current step to current step) and using a screen where this field is set (remove it from the edit screen as well). Then fire in these transitions your own event and add it to your notification scheme.

Udo Brand
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.
May 14, 2013

And add a validator to these transitions that the field got changed. Otherwise it would make no sense.

Kathy Tempesta May 14, 2013

I considered this option too but my workflow is already complex enough that I'm hoping to avoid adding any more steps.

0 votes
Jobin Kuruvilla [Adaptavist]
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.
May 14, 2013

You will have to write a custom listener that captures changes to the field and then notify the user. For notifying user, you can fire a custom event or send the mail directly. Firing event is usually easier.

Kathy Tempesta May 14, 2013

Adding a custom listener was my first thought but I got stumped when I had to pick a Class for the listener. What class should I use?

Jobin Kuruvilla [Adaptavist]
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.
May 14, 2013
Kathy Tempesta May 14, 2013

I will, thanks!

Kathy Tempesta May 18, 2013

I read that but from what I could tell, it is all about writing a plug-in, which is not an option for me. Was the listener class stuff buried in there somewhere?

Yagnesh Bhat
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.
January 12, 2016

@Jobin Kuruvilla [Go2Group] , assuming I have the listener code in place, what would be the EXACT event it needs to listen for a custom field value change and update? I checked the API, couldnt find anything useful. Could u please help?

Jobin Kuruvilla [Adaptavist]
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.
January 12, 2016

There is no event for custom field changes specifically. You will have to catch the "Issue Updated" event and find out if the field was changed by reading the respective change history.

Yagnesh Bhat
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.
January 12, 2016

Thanks @Jobin Kuruvilla [Go2Group] , I am exploring the change history part, but when I checked the API : https://developer.atlassian.com/static/javadoc/jira/4.4.1/reference/com/atlassian/jira/issue/changehistory/ChangeHistoryItem.html, its kind of giving me the whole list of change items updated so far. How can I segregate which custom field was updated on "per update" basis?

Jobin Kuruvilla [Adaptavist]
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.
January 12, 2016
Yagnesh Bhat
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.
January 12, 2016

Works now! Thanks a lot @Jobin Kuruvilla [Go2Group] !

0 votes
Nadir MEZIANI
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.
May 14, 2013

Hi,

In your project notification scheme; in Issue Updated System Events; add "custom user picker field".

Look this link; it can help you.

https://answers.atlassian.com/questions/169599/send-an-email-notification-when-the-issue-s-status-change

Kathy Tempesta May 14, 2013

I'm not sure I understand what you are suggesting. If I use the Issue Updated event, the tester will get a notification any time ANY field is updated in the issue, correct?

I have found that the amount of attention a user pays to JIRA mail is directly inverse to the amount of mail they get. I need to make sure the users only get notifications they really need.

Nadir MEZIANI
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.
May 14, 2013

Hi,

Yes the first; it's correct.

If you haven't add this event in any post function of you workflow, the user receive message when the updated action in the issue tabpanel executed.

I recommend to test it.

Suggest an answer

Log in or Sign up to answer