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

How to get a project area from a WorkItem

Hi there,

Can anyone point me towards any docs about how to get a hold of the project area that a particular WorkItem has come from programmatically please?

Many thanks.

0 votes



3 answers

Permanent link
Hi there,

Can anyone point me towards any docs about how to get a hold of the project area that a particular WorkItem has come from programmatically please?

Many thanks.


I'm getting there slowly with this by doing the following:


ITeamRepository repository = (ITeamRepository) handle.getOrigin();
if (repository != null) {
IWorkItemClient workItemClient = (IWorkItemClient) repository.getClientLibrary(IWorkItemClient.class);
try {
IProcessAreaHandle pah = workItemClient.findProcessArea(workItemHandle, monitor);
}
catch (TeamRepositoryException e) {
....
}



However, doing this causes me the following exception:

11:22:21,125 ERROR com.ibm.team.repository.client.util.ThreadCheck - Long-running operations prohibited on this thread
java.lang.IllegalStateException: Long-running operations prohibited on this thread
at com.ibm.team.repository.client.util.ThreadCheck.checkLongOpsAllowed(ThreadCheck.java:117)
at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invoke(ServiceInterfaceProxy.java:81)
at $Proxy0.fetchOrRefreshItems(Unknown Source)
at com.ibm.team.repository.client.internal.ItemManager$3.run(ItemManager.java:1561)
at com.ibm.team.repository.client.internal.ItemManager$3.run(ItemManager.java:1)
at com.ibm.team.repository.client.internal.TeamRepository$3.run(TeamRepository.java:1169)
at com.ibm.team.repository.common.transport.CancelableCaller.call(CancelableCaller.java:79)
at com.ibm.team.repository.client.internal.TeamRepository.callCancelableService(TeamRepository.java:1162)
at com.ibm.team.repository.client.internal.TeamPlatformObject.callCancelableService(TeamPlatformObject.java:41)
at com.ibm.team.repository.client.internal.ItemManager.internalFetchItem(ItemManager.java:1556)
at com.ibm.team.repository.client.internal.ItemManager.access$0(ItemManager.java:1538)
at com.ibm.team.repository.client.internal.ItemManager$AbstractStore.retrieveItem(ItemManager.java:186)
at com.ibm.team.repository.client.internal.ItemManager$CurrentStore.fetchItem(ItemManager.java:311)
at com.ibm.team.repository.client.internal.ItemManager.fetchPartialItem(ItemManager.java:1059)
at com.ibm.team.workitem.client.internal.AuditableClient.resolveAuditable(AuditableClient.java:131)
at com.ibm.team.workitem.common.internal.WorkItemCommon.findProcessArea(WorkItemCommon.java:760)
......


Any advice/doc on how I should be doing this to avoid getting this exception please?

Thanks,

0 votes


Permanent link
On Thu, 03 Jun 2010 10:38:03 +0000, smithsj wrote:

11:22:21,125 ERROR
com.ibm.team.repository.client.util.ThreadCheck - Long-running
operations prohibited on this thread
java.lang.IllegalStateException: Long-running operations prohibited on
this thread

What you're seeing here is code which prevents you from performing
network operations in the UI thread. We require that all network requests
are made in background threads in order to keep the UI responsive.

The most common way to get code into background threads is to use a Job
(org.eclipse.core.runtime.jobs.Job).

- Jared

0 votes


Permanent link
Hi there,

Can anyone point me towards any docs about how to get a hold of the
project area that a particular WorkItem has come from
programmatically please?

Many thanks.

com.ibm.team.workitem.common.model.IWorkItem.getProjectArea()

--
Regards,
Patrick
Jazz Work Item Team

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
× 11,051

Question asked: Jun 02 '10, 6:57 a.m.

Question was seen: 7,632 times

Last updated: Jun 02 '10, 6:57 a.m.

Confirmation Cancel Confirm