It's all about the answers!

Ask a question

how do you surpress email from a large work item migration?

Virginia Brown (9333941) | asked Nov 20 '12, 10:52 a.m.
edited Nov 20 '12, 10:57 a.m.
Well, we should have saw this one coming, but we just imported a 
thousand records into RTC and immediately started getting pinged 
about the flood of email users were getting.  

We did want to let them know that the migration into RTC 
was complete, but not one record at a time :) 

Question 1:  is there a smarter way than just turning off email 
for the whole repository to avoid email to every ticket owner?

Question 2: the poor guy that did the import is now subscribed to 
every work item. 

Might someone have a script that uses the API to remove a 
subscriber from a named set of tickets? 

A nice toggle for email preferences would be to surpress attaching 
me as a suscriber to tickets I create.  

frederick carter commented Jan 29 '13, 11:23 a.m. | edited Feb 17 '13, 1:48 a.m.

In another posting ,  it was noted that work item  140179 is an enhancement request for suppressing email notifications.  however , i cannot find that work item .  Can someone tell me how to find the enhancement request - 140179?

Geoffrey Clemm commented Feb 17 '13, 1:48 a.m.

3 answers

permanent link
sam detweiler (12.5k6194201) | answered Jan 29 '13, 11:35 a.m.
edited Feb 17 '13, 9:27 a.m.
I think we need a routine that can

1. get the email status for a user
2. set the send me an email flag for that user (to off) for the migration period

later use the data from 1, to restore the send me an email flag, for the user.

| based on quick review of the code, this looks like it will require use of internal classes

no internal classes required.. get the users details record and the email config from the extended attributes
the email config is stored in this key "", and it is an xml document.
if not previously set, the server code uses a default string.

given the contributor record, and the  item manager from the repository connection you can get the email config like this

        IContributorDetailsHandle detailsHandle= contributor.getDetails();
        if (detailsHandle != null)
            IContributorDetails details=
            (IContributorDetails) iim.fetchPartialItem(detailsHandle, IItemManager.REFRESH,
            // get the writeable copy of the details
            details=(IContributorDetails) details.getWorkingCopy();                  
            // get the email config value, if any
            String configVal= details.getLargeStringExtension(CONFIG_KEY);

permanent link
Ralph Schoon (62.7k33643) | answered Nov 22 '12, 1:58 a.m.
Has anyone tried to switch e-mail notification off on the server (advanced properties). If it is off, the server should not send e-mails, right? And that should preserve the subscriptions too.
Unfortunately none of my test servers is set up with e-mail notification, so I can't test. I would be interested in the outcome however.

Virginia Brown commented Nov 22 '12, 1:44 p.m.

Ralph - I would expect that turning off email during the migration would prevent the initial flood of email, but that is a pretty blunt instrument if there are other teams currently in the production system.  For our case, the migration took quite a bit of manual intervention so was done over a three day period. 

Ralph Schoon commented Nov 23 '12, 1:49 a.m.

Hi Virginia, that is a valid concern. In that case some automation would be useful. See some hints and techniques on

See as an idea how to iterate the work items with an expression and use a WorkItemOperation to manipulate it. And about subscriptions (it subscribes, I assume it is relatively easy to find out how to unsubscribe).

Brian Fleming commented Nov 27 '12, 4:13 p.m.

This post discusses a possible issue with disabling email for a short period of time.  I wonder if anyone else has seen the same behavior.

permanent link
Brian Fleming (1.6k11928) | answered Nov 20 '12, 5:57 p.m.
For your second question, I don't have a script, but if you're using RTC 4.0, you can do this from the eclipse client. 
1. Create a query that will return all of the work items this user wants to unsubscribe to
2. Run the query in the eclipse client
3. Select all the work items it returns, right click and select Subscriptions->Unsubscribe me

Virginia Brown commented Nov 21 '12, 9:42 p.m.

Thanks Mark - this  is a good tip for 4.0 users.  

Anyone have help for those of us still on 3.x?

Your answer

Register or to post your answer.