2012-04-19 71 views
2

我在添加自定义“通知类型”(页面上显示的第二列 - http://host:port/secure/admin/AddNotification!default.jspa)时遇到问题。我使用jira 4.2,并且我发现在Jira中负责此任务的界面是http://docs.atlassian.com/software/jira/docs/api/4.2/com/atlassian/jira/notification/NotificationType.html,但我不知道下一步该怎么做。任何帮助,请:) :)如何将自定义通知类型添加到jira

+0

https://studio.plugins.atlassian.com/wiki/display/JCWP/JIRA+Component+Watcher+Plugin增加了一个新的通知类型,应有一些有用的代码? – mdoar 2012-04-19 22:30:33

回答

0

好的解决方案是扩展类AbstractNotificationType - 扩展类前。 MyNotificationType 然后创建像下面的代码另一个类:

public MyNotificationUpdater() { 

    NotificationTypeManager notificationTypeManager = ComponentManager 
      .getComponentInstanceOfType(NotificationTypeManager.class); 
    Map types = notificationTypeManager.getTypes(); 
    if (types == null) {    
     types = new HashMap<String, Object>(); 
    } 
    types.put("MyNotificationType", new MyNotificationType()); 
    notificationTypeManager.setSchemeTypes(types);  
} 
相关问题