It's all about the answers!

Ask a question

How to change the default settings in "Mail Configuration" ?


yk wu (461915) | asked Jan 14 '13, 3:30 a.m.
Dear All,

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.



Mail Configuration

Thanks for reading, and suggestions are always welcome.

Accepted answer


permanent link
Ralph Schoon (63.0k33645) | answered Jan 14 '13, 5:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

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.
yk wu selected this answer as the correct answer

Comments
Ralph Schoon commented Jan 14 '13, 9:32 a.m. | edited Jan 14 '13, 9:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


sam detweiler commented Jun 11 '14, 3:27 p.m.

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



permanent link
VK L (8177153159) | answered Feb 03 '15, 5:00 a.m.
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.

Comments
sam detweiler commented Feb 03 '15, 7:17 a.m.

the only thing I can see that is different is that I ask the Item Manager to REFESH

IContributorDetails details=
            (IContributorDetails) iim.fetchPartialItem(detailsHandle, IItemManager.REFRESH, Collections.singleton(IExtensibleItem.ALL_STATE_EXTENSIONS_PROPERTY),null);


permanent link
VK L (8177153159) | answered Feb 03 '15, 7:56 a.m.
Hi sam,
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
sam detweiler commented Feb 03 '15, 8:01 a.m.

No idea.. my code (linked above) has been working for almost 3 years unchanged without any issue.


Ralph Schoon commented Feb 03 '15, 8:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Your answer


Register or to post your answer.