Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.

1 vote


Accepted answer

Permanent link
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

1 vote

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

Permanent link
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.

0 votes

Comments

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
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.

0 votes

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.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,121
× 52

Question asked: Jan 14 '13, 3:30 a.m.

Question was seen: 6,914 times

Last updated: Feb 03 '15, 8:01 a.m.

Confirmation Cancel Confirm