Notification for a custom user picker field change

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

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

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.

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.

0 vote

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.

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?

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?

@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?

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.

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?

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

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.

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

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

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?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted an hour ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

9 views 0 2
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