It's all about the answers!

Ask a question

How to list the related source code of a workitem?


Andy Jewell (24236174) | asked May 19 '15, 1:56 p.m.
edited May 19 '15, 1:57 p.m.
We associate all source code changes to a work item.  I would like to generate a list of source code associated to a particular work item.  This post and it's follow-up posts is helpful for doing this through the Java API but I would like to do it using lscm.

I can get a list of changes against a work item:

c:\Users\O386600\oracle>lscm -u y locate -r mbeprod -w "hp mbe q 2015 05 o386600" -v -W 9561
(3854:_zoGcwMzCEeSJ84CAI2oi3A) "hp mbe q 2015 05 o386600" (13 of 13) 
  (3855:_8646EcPrEeSJ84CAI2oi3A) ----$ Username 9561 "Issue 1706 HP MBE Q 2015 05 Non-SOA SOA" - "Issue Foo T5 foo Performance Issue" 06-Mar-2015 02:47 AM
<snip>

But then what I thought I could do was to list the changes of those changesets like this:

c:\Users\O386600\oracle>lscm ls changes -r mbeprod -w "hp mbe q 2015 05 o386600" _zoGcwMzCEeSJ84CAI2oi3A

But I get an error:

Problem running 'list changes':
Invalid item type for "_zoGcwMzCEeSJ84CAI2oi3A". Expected type "changeset" but specified item was of type "workspace". Try 'lscm help list changes' for more information.

Incidentally, I tried with the aliases but it didn't work, sometimes UUID works better but it was the same results both ways (as above).

Am I misunderstanding how this would or could work?  Is there another way using lscm to get the source files associated with a work item?

Accepted answer


permanent link
Surya Tripathi (65017) | answered May 19 '15, 4:18 p.m.
 I don't think there is a single command that will list all the 'changes' for a work item. However, you can first list all changesets and then run a command to list changes by passing all the changesets.

1. List all changesets for work item 7204 
>lscm  list changesets -W 7204  -r https://localhost:9443/jazz -u <username> -P <password> 

(1171) 7204 "Multiple_Changeset"
  Change sets:
    (1172) ----$ Surya Tripathi "Changeset1" 19-May-2015 12:32 PM
    (1173) ----$ Surya Tripathi "Changeset2" 19-May-2015 12:33 PM
    (1174) ----$ Surya Tripathi  "Changeset3" 19-May-2015 12:34 PM

2. List changes for all the changesets
>lscm list changes 1172 1173 1174 -r https://localhost:9443/jazz -u <username> -P <password> 
Change sets:
  (1172) ----$ Surya Tripathi "Changeset1"
    Component: (1129) "CATesting1Component1"
    Modified: 19-May-2015 12:32 PM
    Changes:
      ---c- (1175) \<unresolved>\Activator.java
    Work items:
      (1171) 7204 "Multiple_Changeset"
  (1173) ----$ Surya Tripathi "Changeset2"
    Component: (1129) "CATesting1Component1"
    Modified: 19-May-2015 12:33 PM
    Changes:
      ---c- (1177) \<unresolved>\SamplePropertyPage.
    Work items:
      (1171) 7204 "Multiple_Changeset"
  (1174) ----$ Surya Tripathi "Changeset3"
    Component: (1129) "CATesting1Component1"
    Modified: 19-May-2015 12:34 PM
    Changes:
      ---c- (1176) \<unresolved>\plugin.xml
    Work items:
      (1171) 7204 "Multiple_Changeset"
Andy Jewell selected this answer as the correct answer

Comments
Andy Jewell commented May 19 '15, 4:26 p.m.

Ha!  Thank you!  I've never tried putting the arguments before the options like that but apparently it was the source of my problem.  Appreciate your help!

One other answer



permanent link
Ayse Bener (115) | answered Aug 03 '16, 1:07 p.m.
  Hi, 
Thank you for your suggestion. It helps me to connect work item to source code. I am wondering if there is any way to get the full path? it returns \<unresolved>\...

Your answer


Register or to post your answer.