How to list changed files associated to a work item from the scm cli?
We're using Excel sheets to do your code reviews. Previously we did this in ClearCase/UCM, but we've switched to RTC (4.0.2, Win7, 64-bit) and want to use the same process for our reviews. Therefore we're looking to change the vbs scripting in our Excel sheet to address the Work Item's associated Change Sets and their subsequent list of changed files.
Does anyone have an idea how to approach this, since the scm cli doesn't include any commands to address work items, nor their content.
I understand that RTC Source Control is Change Set centered, but in an Work Item integrated environment one might expect you can also get Work Item information from the scm cli.
(ClearCase/UCM can do it and Synergy&Change can do it)
|
Accepted answer
I don't think that there is a SCM command to list the changes associated with a work item. I have got around this by using the REST API to get the list of changesets associated with a workitem and then use the lscm list changes command to get the list of files. Even with this approach, a lot of parsing is required. I use CURL and LSCM from a BASH Script, so probably not much help for your VBA Script. See https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI for more on the REST API. My code looks something like this
# Connect to the REST interface
# Get the WI data where workitem id is returned by ${WI} curl -s -k -b ${COOKIES} "${HOST}/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/${WI}?_mediaType=application/x-oslc-cm-changerequest%2Bjson" # parse the output from above command to find the Changeset OID (sample output below) [],"rtc_cm:com.ibm.team.filesystem.workitems.change_set.com.ibm.team.scm.ChangeSet":[{"rdf:resource":"https:\/\/v3-rtc-clm.stl.int:9443\/ccm\/resource\/itemOid\/com.ibm.team.scm.ChangeSet\/_AL_6YR-QEeO0aJGAYIWppA","oslc_cm:label":"Changes in LDRD - For CT1530 - author- Sep 17, 2013 1:55 PM"}],"rtc_cm:com.ibm.team.workitem.linktype.blocksworkitem.dependsOn":[],"rtc_cm:com.ibm.team.workitem.linktype.resolvesworkitem.resolvedBy":
# Then call SCM to return contents of changeset.
lscm list changes -r "https://hostname:9443/ccm" _AL_6YR-QEeO0aJGAYIWppA You should be able to replace calls to CURL with an object that is able to provide HTTP communication. Stephen Danny Beerens selected this answer as the correct answer
Comments
Danny Beerens
commented Jan 13 '14, 8:26 a.m.
Hi Stephen,
Yes, this is the direction I was looking for.
Thanks!
Regards,
Danny
|
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.
Comments
In scm cli 4.0.6 (upcoming release) we have added a workitem option to the 'list changesets' command to list the change sets of a workitem. There is also an option to show child workitem change sets.