How to get a full description of an activity in cleartool?

寵の児 提交于 2019-12-08 06:56:54

问题


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() 


来源:https://stackoverflow.com/questions/14089291/how-to-get-a-full-description-of-an-activity-in-cleartool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!