Finding what type of Item a UUID represents
10 answers
Well, there isn't any official API for this, but you can do:
- copy the UUID
- paste it into a URL of the form:
<your_repo>/resource/itemOid/com.ibm.team.scm.Component/_DC6QYM0yEd2CTNaxDdYRfg?_mediaType=text/xml
(replacing the UUID there with yours)
- open this in a web browser
- there the XML should indicate the type
For example, in this case the item in our self-hosting repository is a workspace, so the XML is:
Here, the XML namespace is the id for the component (com.ibm.team.scm) defining the item type (Workspace).
- copy the UUID
- paste it into a URL of the form:
<your_repo>/resource/itemOid/com.ibm.team.scm.Component/_DC6QYM0yEd2CTNaxDdYRfg?_mediaType=text/xml
(replacing the UUID there with yours)
- open this in a web browser
- there the XML should indicate the type
For example, in this case the item in our self-hosting repository is a workspace, so the XML is:
<?xml version="1.0" encoding="UTF-8" ?>
<scm:Workspace
xmlns:repository="com.ibm.team.repository"
xmlns:scm="com.ibm.team.scm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" itemId="_DC6QYM0yEd2CTNaxDdYRfg" properties="">
...
Here, the XML namespace is the id for the component (com.ibm.team.scm) defining the item type (Workspace).
You could try just creating a handle of a given type with the UUID, fetching it, then seeing what the actual type is.
e.g.
e.g.
IItemHandle handle = IComponent.ITEM_TYPE.createHandle(uuid, null);
ITeamRepository repo = ...;
IItem item = repo.itemManager.fetchCompleteItem(handle, IItemManager.DEFAULT, null);
IItemType type = item.getItemType();
System.out.println("Simple type name: " + type.getName());
System.out.println("Type's namespace: " + type.getNamespaceURI());
We have problem where the end user will be presented with an error message and part of the message is "... Type=WorkItem, Itemid=(UUID...and then the value). But it doesn't tell us which field in the Work item it pertains to. It doesn't always occur. But it would be nice if we could instruct the person what to do in order to see which field is the problem.
We just do basic configuration of a Work Items - so we are not doing anything special that includes overt creation / association of UUIDs.
Does this point to something wrong in RTC 3.0.1 ? (not the fact that we get an error, but the fact that we do see the name of the field that is in error).
We just do basic configuration of a Work Items - so we are not doing anything special that includes overt creation / association of UUIDs.
Does this point to something wrong in RTC 3.0.1 ? (not the fact that we get an error, but the fact that we do see the name of the field that is in error).
Please file a work item against the Work Items team for this issue, including what steps lead to that error. At minimum, it's a pretty poor error message, and we're doing a pass to improve error messages in general in 4.0 M8 (our next milestone, starting next week).