It's all about the answers!

Ask a question

RTC API - how to create a link to a changeSet


Zaid Al-Khishman (351115) | asked Mar 27 '15, 6:55 p.m.
I need to be able to create a link to an IChangeSet which I would then include in an email. I've gotten as far as
IReferenceFactory.INSTANCE.createReferenceToItem(ChangeSetHandle).createURI().toString()
which is giving me: itemOid/com.ibm.team.scm.ChangeSet/_MAfk4NTPEeSroOe43qBfkg
for one instance.

While I'm expecting something like:
https://fullyqualifieddomainwithoptionalport/ccm/rest/of/link

How would I go about doing this?

I think I may need to use getPublicRepositoryURL()  along with some other methods before I get there.

Thanks

Accepted answer


permanent link
Ralph Schoon (63.6k33646) | answered Apr 01 '15, 3:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This is most likely not the URL you want. If I copy the URI in the Eclipse client I get this form of a URL

https://clm.example.com:9443/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_K6Bi8MMyEeS_OtxSf45u8Q

Or

https://clm.example.com:9443/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_K6Bi8MMyEeS_OtxSf45u8Q?Workspace=_GcrsgH-oEeSHhcw_WFU6CQ

if the workspace is of interest.

Or https://clm.example.com:9443/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_cjx2gIBYEeSaLuTOD5yLUA?projectAreaId=_55re8H-nEeSHhcw_WFU6CQ&workspace=_G5hZgH-oEeSHhcw_WFU6CQ in the Web UI. So I would assume it looks at least like

https://clm.example.com:9443/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_cjx2gIBYEeSaLuTOD5yLUA where the last part of the URL is the UUID of the change set.

Look into the class Location. There are different ways to create Locations from data. e.g. Location.namedLocation() the same for creating references

IReferenceFactory.INSTANCE.createReferenceToItem() and IReferenceFactory.INSTANCE
                            .createReferenceFromURI()

The method to create the location, the location format and the way to create the reference must match.

Zaid Al-Khishman selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.6k33646) | answered Mar 28 '15, 5:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Look into the code of https://rsjazz.wordpress.com/2015/02/27/a-rtc-workitem-command-line-version-2-2/

Comments
Zaid Al-Khishman commented Mar 31 '15, 3:42 p.m.

I couldn't find what I'm looking for here. I think the most relevant file is WorkItemHelper.java. I see that it creates references from URIs but not the other way round. I may be mistaken.

I ended up doing it like this:

getPublicRepositoryURL() + "web/projects/" + projectArea.getName() +"#action=com.ibm.team.scm.viewChangeSet&changeSetItemId=" + changeSetUUID.getUuidValue() + "&projectAreaItemId=" + projectArea.getItemId().getUuidValue();

for those who need it.

Your answer


Register or 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.