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

RTC API - how to create a link to a changeSet

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

0 votes


Accepted answer

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

1 vote


One other answer

Permanent link
 Look into the code of https://rsjazz.wordpress.com/2015/02/27/a-rtc-workitem-command-line-version-2-2/

1 vote

Comments

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 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
× 10,938

Question asked: Mar 27 '15, 6:55 p.m.

Question was seen: 3,429 times

Last updated: Apr 01 '15, 3:59 a.m.

Confirmation Cancel Confirm