Remove notificationRecipient (emails) in Linstener of plugin

Hi Experts,

I want to stop notification for few emails. I found the NotificationFilter class which has method called
`removeRecipient(NotificationRecipient recipient, NotificationFilterContext context). So how can I create object of these classs and remove recipient using this class.

Please find my Listener code here:

    public void onIssueEvent(IssueEvent issueEvent) throws RemoveException {
    	 if (issueEvent.isSendMail()) {
    		 NotificationSchemeManager notificationSchemeManager = ComponentAccessor.getNotificationSchemeManager();
    		 Set<NotificationRecipient> notificationRecipients = notificationSchemeManager.getRecipients(issueEvent);
    		 for (NotificationRecipient notificationRecipient : notificationRecipients) {

Note: I am getting all notification recipient in code and Now i want to remove one recipient ( using below class. How to get these below objects in my code.

  • NotificationFilterManager
  • NotificationFilterContext

Reference Link:

@david.pinn @danielwester @epehrson

Any solution for this ?