Recommended way to obtain a work item given a work item numb
I am working on a feature that extracts a work item number from some
text and I need to translate that into a work item. I got this to work in the Eclipse client using a Location that contains the URI for a work item as obtained from the work item editor. However, this approach does not work on the server since it requires the use of the Item Manager (and is rather round about in the first place). What is the recommended way to fetch a work item given the work item number from both an Eclipse client and from the server (i.e. a scheduled task)? Michael |
2 answers
Hi Michael,
The closest what we have today is the predefined query WorkItemQueries.workItemById(...) that returns a WorkItemHandle via an ItemQueryIterator. This isn't the easiest API to use, but since it lives in common, it is at least available both on the server and the client. I've create enhancement request 37012 for providing a better API within the M4 timeframe. Cheers, --andre On 2007-11-19 20:41:14 +0100, Michael Valenta <Michael_Valenta@ca.ibm.com> said: I am working on a feature that extracts a work item number from some |
Michael -
If you have a Location on the server, you can use the ILocationService to resolve the location to an IItem. However, if you only have the item number Andre's suggestion is the way to go, rather than crafting by the URI by hand. -- Todd Michael Valenta wrote: I am working on a feature that extracts a work item number from some |
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.