How to change the default settings in "Mail Configuration" ?
I am working with a customer that wants to change the default settings in "Mail Configuration", somewhat like screen below.
Reason is that customer wants to get email notification for everyone, but only under fewer situations than default. There are many users in RTC, and setting up a new default "Mail Configuration" is needed.
My question is similar to "https://jazz.net/forum/questions/85712/modifying-the-template-of-the-mail-notifications-in-rtc-3x", unfortunately, there has been no answer so far.
Thanks for reading, and suggestions are always welcome.
Accepted answer
I was not able to find a setting for the mail configuration. Maybe someone has more info.
I was however able to find how the configuration is set in the Java API. It is part of the details of a contributor.
You can access the data using the following code:
IContributorDetails details = (IContributorDetails) teamRepository .itemManager().fetchCompleteItem( contributorWorkingCopy.getDetails(), IItemManager.DEFAULT, null); details = (IContributorDetails) details.getWorkingCopy(); IContent photo = details.getPhoto(); String mailconfig = details.getLargeStringExtension("com.ibm.team.workitem.mail.Configuration");
You can follow http://rsjazz.wordpress.com/2013/01/08/maintaing-user-photos-with-the-plain-java-client-libraries/ and provided you get the default from an example user, use that to set the default using a commandline.
You might need to go through Hong Kong to get at the blog.
In case of WordPress blogs, you can append the string ".nyud.net" to the blog URL and it should open just fine. For instance, if the main blog is located at labnol.wordpress.com, you can access a mirror image of this site from labnol.wordpress.com.nyud.net."
We have seen http://rsjazz.wordpress.com.nyud.net/ is accessible through Hong Kong.
Sorry, my best solution at the moment.
Comments
The code can be found in com.ibm.team.workitem.ide.ui.internal.mailconfig.MailConfigFormPage.doSave(IProgressMonitor);
I am not sure the code it uses is a public API.
there is no builtin function to set them a specific way.
I wrote a utility to save/restore them to stop spam during build workitem updates,
it could be modified to set a specific email configuration.
see the answer here https://jazz.net/forum/questions/137079/resolved-not-a-bug-with-user-mail-settings-and-receivemails
note: it uses internal apis, and as such is subject to impacts from product changes.
2 other answers
Hi All,
I have written a code to update mail format settings - it fails to fetch the contributor details and throuws null exception on the mailconfig retrieval:
*It works after i open the particular user in the editor and perform a save.
user = icm.fetchContributorByUserId(userid, null);
contributorWorkingCopy = (IContributor) user.getWorkingCopy();
icm.saveContributor(contributorWorkingCopy, null);
IContributorDetailsHandle detailsHandle = contributorWorkingCopy.getDetails();
details = (IContributorDetails) iim.fetchCompleteItem(detailsHandle,IItemManager.DEFAULT, null);
details=(IContributorDetails) details.getWorkingCopy();
String mailconfig = details.getLargeStringExtension("com.ibm.team.workitem.mail.Configuration");
mailconfig value is retrieved as null.Please advise.
If i open user "a" in the editor, and save it with 0 changes (*just inserting a space and removing it for example)
update code runs fine for the above case. it fetches mail config and updates.
For all other user ids, it fails to read the mail config via "getlargestringextension" - i tried both default,refresh. The mail config is retrieved as null, other properties of details like mail address,etc have values.
Comments
No idea.. my code (linked above) has been working for almost 3 years unchanged without any issue.
Please, next time, create a new question, as the one is already closed as answered.
I would suggest to search the SDK for usage of the statement you are not sure how to use. In most cases the examples reviled explain the issue.