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

Accessing the Time Zone of User/Contributor of a Work item

Is is possible to access the TimeZone of the contributor of a workitem using the Java APIs ?

I get the IContributor of a work item and then access the IContributorDetails. But I am unable to get the time zone information in the details.

Regards,
Renuka

0 votes



One answer

Permanent link
It looks like the Work Location settings, including time zone, for a user are not stored as string extensions on the IContributorDetails (like work item email settings are) but rather as a modeled item in the Agile Planning support.

com.ibm.team.apt.common.resource.IWorkLocationDefinition
has properties: timeZone, zoneOffset, language, country, variant, workDays

I don't see any public API for obtaining this, but there's an internal client library.
See:

com.ibm.team.apt.internal.client.resource.ResourcePlanningClient:
ResourcePlanningManager getResourcePlanningManager()

com.ibm.team.apt.internal.client.resource.ResourcePlanningManager:
IContributorInfo getContributorInfo(final IContributorHandle contributor, final boolean refresh, final IProgressMonitor monitor)

com.ibm.team.apt.internal.client.resource.IContributorInfo:
IWorkLocationDefinition getWorkLocation(IContributorHandle contributor)

So something like: teamRepository.getClientLibrary(ResourcePlanningClient.class).getResourcePlanningManager().getContributorInfo(contributorHandle, false, aMonitor).getWorkLocation(contributorHandle)
should do the trick.

Hopefully the planning team won't have my head for pointing you this way.

0 votes

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
× 10,941

Question asked: Jun 14 '10, 1:19 a.m.

Question was seen: 6,299 times

Last updated: Jun 14 '10, 1:19 a.m.

Confirmation Cancel Confirm