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

How to list the related source code of a workitem?

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?

0 votes


Accepted answer

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

1 vote

Comments

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
  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>\...

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
× 12,019
× 369
× 158
× 40

Question asked: May 19 '15, 1:56 p.m.

Question was seen: 3,983 times

Last updated: Aug 03 '16, 1:07 p.m.

Confirmation Cancel Confirm