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

Finding what type of Item a UUID represents

Is there a way to find the type of ITEM (Baseline, workspace, snapshot...) a UUID represents?

1 vote



10 answers

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

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

1 vote


Permanent link
Sorry I need to be able to do this using the Java API, is it possible.

0 votes


Permanent link
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.
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());

0 votes


Permanent link
Just curious: why do you need to do this? Normally the UUID should be paired with its item type.

0 votes


Permanent link
Since name are not unique in rtc we are storing UUID, it would be nice to know what a UUID represents when we have problems.

0 votes


Permanent link
In RTC itself, when we store a reference to another item, we store an item handle, which is: item type + item UUID .

I suggest you store the item type too, not just the UUID.

0 votes


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

0 votes


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

0 votes


Permanent link
Will do. Thanks for the response.

0 votes


Permanent link
Work Item submitted.

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=193330

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

Question asked: Nov 28 '11, 3:03 p.m.

Question was seen: 10,776 times

Last updated: Nov 28 '11, 3:03 p.m.

Confirmation Cancel Confirm