Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JIRA 6 problem with custom notification type

Ray Ray June 22, 2013

Hi, my name is Ray Barham and I'm the developer of the JIRA Component Watchers Plugin. I'm have problems getting my plugin to work with JIRA 6. My plugin creates a custom notification type to handle sending notifications. The com.atlassian.jira.notification.type.NotificationType enum in jira-api specifies the notification types, but, any notification type not defined in this file is reported as invalid.

Here is some of the exception from the log:

[INFO] [talledLocalContainer] 2013-06-22 12:45:10,379 http-2990-16 ERROR admin 762x2077x1 18iaifs 127.0.0.1 /secure/CreateIssueDetails.jspa [jira.event.issue.IssueEventListenerHandler] Exception thrown invoking listener [com.atlassian.jira.event.listeners.mail.MailListener] : You have to provide a valid mapped string
[INFO] [talledLocalContainer] java.lang.IllegalArgumentException: You have to provide a valid mapped string
[INFO] [talledLocalContainer] 	at com.atlassian.jira.notification.type.NotificationType.from(NotificationType.java:55)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.event.listeners.mail.MailListener.addMailItems(MailListener.java:123)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.event.listeners.mail.MailListener.sendNotification(MailListener.java:95)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.event.listeners.mail.MailListener.issueCreated(MailListener.java:146)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.event.issue.AbstractIssueEventListener.workflowEvent(AbstractIssueEventListener.java:100)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.event.issue.IssueEventListenerHandler$IssueEventInvoker.invoke(IssueEventListenerHandler.java:51)
[INFO] [talledLocalContainer] 	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66)
[INFO] [talledLocalContainer] 	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:32)
[INFO] [talledLocalContainer] 	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:60)
[INFO] [talledLocalContainer] 	at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
[INFO] [talledLocalContainer] 	at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)

Is it possible to get around this? I can't make my plugin completely compatible with JIRA 6 unless my custom notification type can be handled by JIRA.

Thank you for any assistance.

-Ray

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Ray Ray April 22, 2014
Sorry for just now responding. Turns out it is just not possible to have custom notification types in Jira 6 without modifying Jira source. I had to create a version that uses the "All Watchers" type instead. This was the simplest and quickest solution to the problem. I'm aware that this is inconvenient to people. However, the alternative would be to move away from using the notification scheme altogether and I didn't feel comfortable doing that at this time. An updated version is available on the marketplace.
1 vote
mlassau_atlassian
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.
April 7, 2015

Please see discussion of this issue at

 https://jira.atlassian.com/browse/JRA-42344

In short - Notification Types were not declared as an official customisation API. They just happened to kind of work in 5.0 as an accident. If people think that they should be customisable then please raise an Improvement request on https://jira.atlassian.com/browse/JRA.

See https://developer.atlassian.com/display/JIRADEV/Java+API+Policy+for+JIRA for details of the official JIRA API policy.

0 votes
DevOps
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 22, 2014

Hello,

Ray,

I have the same erorror in recently upgraded from 5.1 to 6.2.2 JIRA .

Can you suggest solution ?

Does it affect other notiifcations ?

We use CW plugin : version 2.3.0

Regards,

Nikolai

Jasen Sparacino June 23, 2014

After I updated jira, then the plugin, I noticed the error scrollling by every second tailing the log file. To stop the error I had to go the notification schemes and manually remove all the lines that used say

  • Component Watcher (Delete)

after the updates the lines looked like this

  • (Delete)

After I deleted the (Delete) lines the errors stopped.

Phillip Ponzer [Cprime]
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.
June 29, 2014

What version of JIRA (and the plugin) did you update to?

Jasen Sparacino June 29, 2014

We went from 5.2.7 of jira to 6.2.5. I think the version of the componet watcher we had 2.3.0 of the plugin before update and now we are at 2.3.4. We have had all version of the plugin at one time and we have had all versions of JIRA since 3.X.

Phillip Ponzer [Cprime]
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.
June 29, 2014

Thanks! I'll be updating my instance of JIRA soon and I'll try to report back my findings.

0 votes
Phillip Ponzer [Cprime]
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, 2014

Ray, were you able to fix this issue? We utilize your plugin quite a bit and we're getting GB's of log data from it (with this same error) :-o

0 votes
Michael Garvin December 16, 2013

Hi Ray, I'm consiring taking a look at the refactoring, I see the source code is available, maybe I can take a crack at it, unless you are already doing it now? Can you contact me and let me know if you have any thoughts on the refactoring? (mgarvin@avaya.com) I need to get management approval to commit some time to it, but want to at least explore what level of effort is involved.

0 votes
LaszloB June 25, 2013

Hi Ray,

first of all, thanks for the effort made on component watchers plugin, we'd be using it on JIRA 6 as well, if it can be tailored to work.

Consulting the API docs my best guess would be that a refactor of the previous code would be needed, and the desired functionality could be achieved by implementing a NotificationFilter (https://developer.atlassian.com/static/javadoc/jira/6.0.3/reference/com/atlassian/jira/notification/NotificationFilter.html), which would only handle issue events, and would update recipient list according to component watcher settings (e.g. addRecipient could add all users/groups watching the component not already recipients, while removeRecipient could remove users not watching the component or not being part of a component watcher group).

NotificationFilterContext can identify if this context is specific to some issue event (reason), obviously the single relevant reason when this custom NotificationFilter should be fired.

I admit I might be overlooking some aspect, but for the first glance this could work with a medium refactor on the current code.

Please, keep us posted if having any progress.

Cheers,

Laszlo

Ray Ray June 28, 2013

Thanks for the tip, Laszlo! Much appreciated. I'll look into if it can be done using the notification filter.

MattS
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.
December 16, 2013

I was always impressed that you got that part to work with JIRA 5

Dieter Greiner March 6, 2015

@ray First: thank's for your plugin :-) I walked through the source code today and noticed your workaround to reuse the "All watchers" notification type in the notification filter. I think it's still a bug in JIRA 6 since NotificationtypeManager.setIssueTypes() is broken now. For this reason i have created https://jira.atlassian.com/browse/JRA-42344

0 votes
Ray Ray June 22, 2013

To be clear, this probem is happening in JIRA 6. The plugin works fine in JIRA 5.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events