It's all about the answers!

Ask a question

Query to show work items included in a build


Ken Greenlee (163) | asked May 13 '11, 3:53 p.m.
We use RTC 2.x to create and build our software product. Is there any query we can run to list the work items that are included in a build? I know I can open the build results and click the link. However, we typically have multiple builds between driver refreshes. We need to visit each build results and manually compile a list of all the defects/user stories/tasks that were included.

Is there a way I can either give a range or set of build results and have the set of work items included returned to me grouped by type (user store, defect, task, etc.)?

Is there a way we can create the list of included work items when doing the build, possible using some ANT task or script?

--Ken Greenlee

9 answers



permanent link
Brent Ulbricht (2.5k11) | answered May 14 '11, 2:30 p.m.
JAZZ DEVELOPER
We use RTC 2.x to create and build our software product. Is there any query we can run to list the work items that are included in a build? I know I can open the build results and click the link. However, we typically have multiple builds between driver refreshes. We need to visit each build results and manually compile a list of all the defects/user stories/tasks that were included.

Is there a way I can either give a range or set of build results and have the set of work items included returned to me grouped by type (user store, defect, task, etc.)?

Is there a way we can create the list of included work items when doing the build, possible using some ANT task or script?

--Ken Greenlee


Hi Ken,

If you are using or can use the build toolkit's teamAccept Ant task there is an attribute named 'changeSetFile=<your outptut file>' that will contain the change sets.

If you were using 3.0, you could also use the generateChangeLog Ant task. You can find more information for that Ant task in the documentation or at https://jazz.net/wiki/bin/view/Main/BuildFAQ#ChangeLog .

If neither of these Ant tasks work in your environment, I would recommend checking out the SCM command line tools 'scm compare' option. The command might look something like 'scm compare --username <user> --password <password> --repository-uri <repository uri> workspace <workspace name> stream <stream name>' .

Brent Ulbricht
Developer/Lead - RTC Build

permanent link
Steve Woodruff (5132) | answered Jun 09 '11, 10:32 a.m.
I have a similar question... can we accomplish this via the SDK? Let's say I have two build labels and I want to get the list of work items included in each build between those two build labels, inclusive. Is this possible with IBuildResultQueryModel ?

Thanks!

--Steve

permanent link
Brent Ulbricht (2.5k11) | answered Jun 09 '11, 4:30 p.m.
JAZZ DEVELOPER
I have a similar question... can we accomplish this via the SDK? Let's say I have two build labels and I want to get the list of work items included in each build between those two build labels, inclusive. Is this possible with IBuildResultQueryModel ?

Thanks!

--Steve


Hi Steve,

Typically compares are done between baselines or snapshots, but in your case you want to do a compare between builds based on the build label. I don't know of an API to automatically handle that, but this topic discusses how to get the work items included in a build result and you could use that for the two builds to compare the two. If you wanted to compare baselines, this topic has some posts about that.

Brent Ulbricht
RTC Build Lead

permanent link
Steve Woodruff (5132) | answered Jun 13 '11, 11:33 a.m.
Hi Brent - thanks for the links. I've already seen the first one, but am looking at the 2nd one now.... we do have snapshots for each of our nightly builds so I could use those in the comparison...

permanent link
Rick Chapman (7111312) | answered Jun 15 '11, 3:52 p.m.
Here's something that might help with that and a problem at the same time :-) In our build setup, we use the scm command to compare the current build snapshot to the previous build snapshot to get the list of changes. Normally this works great

wsuuid=`scm -u y -a n list workspaces -c $myuser -m 9999 -r $myrepos -u $myuser | grep "\"$mywsname\"" | awk '{ print $1 }' | sed "s/(//" | sed "s/)//"

last2snapshots=`scm -u n -a n list snapshots -m 2 $wsuuid -r &myrepos -u $myuser`
currentSnapshot=`echo "$last2snapshots" | head -1 | awk '{ print $1 }'
previousSnapshot=`echo "$last2snapshots" | tail -1 | awk '{ print $1 }'

buildChanges=`scm -u n -a n compare snapshot $currentShapshot snapshot $previousSnapshot -r &myrepos -u $myuser`

You can try the above which has always worked for our builds until just recently. There is one build where I keep getting an error like this to that snapshot compare command. I don't get it since there is only one snapshot named 201106142200. What am I doing wrong???

Ambiguous selector "201106142200" matched multiple items:
Possible matches:
Unexpected exception
java.lang.RuntimeException: Unknown item type com.ibm.team.repository.common.model.impl.ItemTypeImpl@4b1a4b1a (namespaceURI: com.ibm.team.scm, name: BaselineSet, abstract: false)
at com.ibm.team.filesystem.cli.core.util.SubcommandUtil$$Cold.getNameOf(Unknown Source)
at com.ibm.team.filesystem.cli.core.util.SubcommandUtil.getNameOf(Unknown Source)
at com.ibm.team.filesystem.cli.core.util.SubcommandUtil.displaySelectorException(Unknown Source)
at com.ibm.team.filesystem.cli.client.internal.subcommands.CompareCmd.resolveItem(CompareCmd.java:388)
at com.ibm.team.filesystem.cli.client.internal.subcommands.CompareCmd.run(CompareCmd.java:158)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(Unknown Source)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.doStart(Unknown Source)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(Unknown Source)
at com.ibm.team.filesystem.cli.core.internal.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
at org.eclipse.equinox.launcher.Main.run(Unknown Source)
at org.eclipse.equinox.launcher.Main.main(Unknown Source)

permanent link
Geoffrey Clemm (30.1k33035) | answered Jun 15 '11, 4:24 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Rick,

That is clearly a bug (no command should generate an Unexpected
Exception). Please submit a defect report so that we can get that
fixed. But hopefully someone on the forum can give you a pointer on
how to workaround this bug until it is fixed.

One random suggestion: rename that snapshot to have some kind of
alphabetic prefix, in case the lookup method is getting confused by a
string that can be converted into an integer.

Cheers,
Geoff

On 6/15/2011 3:53 PM, chtbuild wrote:
Here's something that might help with that and a problem at the same
time :-) In our build setup, we use the scm command to compare the
current build snapshot to the previous build snapshot to get the list
of changes. Normally this works great

wsuuid=`scm -u y -a n list workspaces -c $myuser -m 9999 -r $myrepos
-u $myuser | grep "\"$mywsname\"" | awk '{ print
$1 }' | sed "s/(//" | sed "s/)//"

last2snapshots=`scm -u n -a n list snapshots -m 2 $wsuuid -r
&myrepos -u $myuser`
currentSnapshot=`echo "$last2snapshots" | head -1 | awk '{
print $1 }'
previousSnapshot=`echo "$last2snapshots" | tail -1 | awk '{
print $1 }'

buildChanges=`scm -u n -a n compare snapshot $currentShapshot snapshot
$previousSnapshot -r&myrepos -u $myuser`

You can try the above which has always worked for our builds until
just recently. There is one build where I keep getting an error like
this to that snapshot compare command. I don't get it since there is
only one snapshot named 201106142200. What am I doing wrong???

Ambiguous selector "201106142200" matched multiple items:
Possible matches:
Unexpected exception
java.lang.RuntimeException: Unknown item type
com.ibm.team.repository.common.model.impl.ItemTypeImpl@4b1a4b1a
(namespaceURI: com.ibm.team.scm, name: BaselineSet, abstract: false)
at
com.ibm.team.filesystem.cli.core.util.SubcommandUtil$$Cold.getNameOf(Unknown
Source)
at
com.ibm.team.filesystem.cli.core.util.SubcommandUtil.getNameOf(Unknown
Source)
at
com.ibm.team.filesystem.cli.core.util.SubcommandUtil.displaySelectorException(Unknown
Source)
at
com.ibm.team.filesystem.cli.client.internal.subcommands.CompareCmd.resolveItem(CompareCmd.java:388)
at
com.ibm.team.filesystem.cli.client.internal.subcommands.CompareCmd.run(CompareCmd.java:158)
at
com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(Unknown
Source)
at
com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.doStart(Unknown
Source)
at
com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(Unknown
Source)
at
com.ibm.team.filesystem.cli.core.internal.Application.start(Unknown
Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown
Source)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown
Source)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown
Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown
Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown
Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
at org.eclipse.equinox.launcher.Main.run(Unknown Source)
at org.eclipse.equinox.launcher.Main.main(Unknown Source)

permanent link
Nick Edgar (6.5k711) | answered Jun 15 '11, 6:31 p.m.
JAZZ DEVELOPER
The message:
Ambiguous selector "201106142200" matched multiple items:

suggests there are multiple snapshots with that name. The subsequent stack trace looks like it then failed in trying to list the matches.

permanent link
Rick Chapman (7111312) | answered Jun 16 '11, 3:36 p.m.
I checked the complete list of snapshots and there is only one with that name and none that include that string as part of their name. I tried using the snapshot uuid instead of the snapshot label in the compare command and it works so I've changed my code to do that from now on. Meanwhile, I did open work item 169150 as suggested since the "unexpected exception" shouldn't occur regardless.

permanent link
Nick Edgar (6.5k711) | answered Jun 16 '11, 4:01 p.m.
JAZZ DEVELOPER
Note that snapshots for other workspace/streams may have the same name (if you were looking only at the snapshots for a given workspace/stream).
I suggest using Search > Jazz Source Control > Snapshots... if you haven't already.

Glad to hear you got it working, though, and thanks for filing the work item.

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.