Temporary disable e-mail alerts before WI comment
I'm using the Java API to add a comment to a workitem as follows
I use this to add a comments to multiple workitems, each comment containing references to all the others: i.e.
"Task 12345, Task 67891, Defect 76543"etc so that a user can read the comment in one workitem and be able to click the Task Numbers to get to the others.
But because it's a link, anybody with with e-mail alerts for mentions links who is subscribed to all the workitems gets a LOT of e-mail.
My question - is it possible to silently create these links without firing the event for the mentions link which sends the e-mail out?
Or is it possible to temporarily disable the event listener which picks up the Mentions Link creation before I make the comment, then reinstate it afterwards?
Any suggestions?
/*
* Generate a working copy of the work item which can be modified.
*/
WorkItemWorkingCopy workingCopy = workingCopyManager.getWorkingCopy(workItemHandle);
IWorkItem workItemToBeModified = workingCopy.getWorkItem();
/*
* Get the comments create a new one, and save the change.
*/
IComments comments = workItemToBeModified.getComments();
IComment comment = comments.createComment(myRepository().loggedInContributor(), XMLString.createFromXMLText(commentText));
comments.append(comment);
workingCopy.save(null);
I use this to add a comments to multiple workitems, each comment containing references to all the others: i.e.
"Task 12345, Task 67891, Defect 76543"etc so that a user can read the comment in one workitem and be able to click the Task Numbers to get to the others.
But because it's a link, anybody with with e-mail alerts for mentions links who is subscribed to all the workitems gets a LOT of e-mail.
My question - is it possible to silently create these links without firing the event for the mentions link which sends the e-mail out?
Or is it possible to temporarily disable the event listener which picks up the Mentions Link creation before I make the comment, then reinstate it afterwards?
Any suggestions?