I used ClearQuest to export a query to a csv containing information about all my developer activities. However, the description is truncated. Is there a cleartool command that can output the full description of a given activity?
问题:
回答1:
You can use something like...
foreach act ( `cleartool lsact -s` )
set changeset = `cleartool lsact -fmt "%[versions]p" $act`
echo $changeset | tr ' ' '\n' >> $tmpoutput
end
foreach line ( "`cat $tmpoutput`" )
set file=`echo $line | sed -e "s|\(.*\)@@.*|\1|"`
end
This list the changed set for the activity (excluding @@).
Source:
http://www.snip2code.com/Snippet/961/list-files-changed-in-clearcase-ucm-stre?fromPage=1
回答2:
You can try
cleartool descr -l activity:MyActivity@\myPVob
You need to use the fully qualified name of the activity: activity:xxx@\mypvob
(Windows) or activity:xxx@/vobs/mypvob
(Unix)
You can also look into fmt_ccase
, in order to describe only what you want out of the long description given by a simple descr -l
.
%[versions]CQp
would list all the versions of a given activity%c
would only display the comment associated with the activity
So this could be enough:
cleartool descr -fmt "%c" activity:MyActivity@\myPVob
or
cleartool lsactivity -fmt "%c" activity:MyActivity@\myPVob
The headline would be obtained with %[headline]p
.
This data should be available, even though in a ClearQuest-enabled project, any UCM activity is auto-transitioned to a ClearQuest work item, linked through its SQUID (SUM ClearQuest Integration Doodad).
As mentioned here, %[crm_record_id]p
and %[crm_state]p
give you access to the ClearQuest® record ID and the activity's state.
However, regarding the comment specifically, you won't find it on the ClearCase activity.
As illustrated by this technote, it looks like this:
cleartool lsact -long ACT00032163
activity "ACT00032163"
16-May-06.14:58:24 by Joe User (jou)
"Created automatically as a result of 'Work On' action in ClearQuest"
owner: jou
group: liteline
stream: jou-act3g-v1.0-2@/vobs/projects
title: Draft of Test cases for UC01-1,2,3,7,8,10,11,30,32 and 04-2
change set versions:
...
So the ClearCase comment is a generated one.
For accessing the Description field of a ClearQuest record, you need to use the ClearQuest API (VB script for instance):
- first to build a ClearQuest session,
- then getting the right record by its id, which you have through
%[crm_record_id]p
, as mentioned above.
That would be something like:
require CQPerlExt;
$CQsession = CQSession::Build();
set cqrecord = sessionObj.GetEntity("defect", "BUGID00000031")
set cqdescrfield = cqrecord.GetFieldValue("Description")
set cqdescr = cqdescrfield .GetValue()