|
首页
>> 配置管理
>> IBM Rational ClearQuest / ClearDDTS/TestManager
|
| [实现CQ需求]--9. 怎样在发给用户的Email提醒信中,自动包含... |
| 作者 anthelion 查看 7728 发表时间 2006/10/30 14:07 【论坛浏览】 |
| 引用: | | 在 derd 发的那个帖子中我跟的帖子不够详细,现在我写一下详细的步骤.-------想走捷径,结果总是走弯路:-) |
|
1.在Defect中加一条字段email_link,String类型.并置于Record form上面
2.在CQ的Global Scipt-->Perl中添加一个方法叫做 SetDefectEmailLink,然后把下面的代码拷贝到里面去.
| 引用: | my($dbid);
my($userdbname);
my($schemadbname);
my($defname);
my($dbDescObj);
my($emailLink);
my($session);
# inite the session
$session = $entity->GetSession();
# Get ID
$dbid = $entity->GetFieldValue("dbid")->GetValue();
# Get userdb name
$dbDescObj = $session->GetSessionDatabase();
$userdbname = $dbDescObj->GetDatabaseName();
# Get entity definiation name
$defname = $entity->GetEntityDefName();
# Set your CQ web address
$schemadbname = "CQ_Connection_Name"; # for example "2003.06.00"
$webpc = "xxx.xxx.xxx.xxx"; # for example 192.168.0.3
# Get the Defect email link
$emailLink = "http://".$webpc."/cqweb/main?command=GenerateMainFrame&service=CQ&schema=".$schemadbname."&contextid=".$userdbname."&entityID=".$dbid."&entityDefName=".$defname;
$entity->SetFieldValue("email_link", $emailLink); |
|
3. 在Defect的Submit action的Validation中加入一行
4. 保存Schema,Upgrade Database,Submit Defect后,查询该Defect,看看email_link中是不是有该Defect的emailink,然后再点击测试一下.
5.在Email Rule的邮件通知规则中的邮件通知字段中,加上这个email_link字段.
*论坛中可能会把http的东西加上个URL,不要把论坛自动加上的东东也copy进去.
*如果你在Defect中加的字段不叫email_link,假如叫foobar,那你要把$entity->SetFieldValue("email_link",$emailLink)改成
$entity->SetFieldValue("foobar",$emailLink);
*祝大家可以顺利通过测试.
*如有遗漏,烦请指正.
[ 本帖最后由 anthelion 于 2006-10-30 16:34 编辑 ] |
| 序号 |
评论者 |
共有评论 38 【论坛浏览】 【发表评论】 |
评论时间 |
|
| 1 |
听雨屋檐人 |
支持楼主!马上测试中! |
2006/10/30 14:22 |
|
| 2 |
听雨屋檐人 |
楼主请看报错情况:
Validating Schema...
Global HookDef "SetDefectEmailLink" : Validation failure from the HookDef language processor:
(in cleanup) Can't call method "GetSession" on an undefined value at (eval 63) line 13."
1 error(s) found
Validating Form(s)...
0 warning(s) found |
2006/10/30 15:27 |
|
| 3 |
anthelion |
前面定义变量加一个
my ($session)
再试. |
2006/10/30 15:52 |
|
| 4 |
听雨屋檐人 |
继续报错 Validating Schema...
Global HookDef "SetDefectEmailLink" : Validation failure from the HookDef language processor:
(in cleanup) Search pattern not terminated at (eval 63) line 31."
1 error(s) found
Validating Form(s)...
0 warning(s) found |
2006/10/30 16:22 |
|
| 5 |
懂你 |
听雨,你看看你新加的这个GlobalScript是不是叫SetDefectEmailLink?
如果不是的话,改一下应该就可以了! |
2006/10/30 16:34 |
|
| 6 |
anthelion |
刚才没注意,多加了个},已经删除. |
2006/10/30 16:34 |
|
| 7 |
听雨屋檐人 |
| 引用: | 原帖由 anthelion 于 2006-10-30 16:34 发表
刚才没注意,多加了个},已经删除. |
|
这个我发现了!
我贴的错误是去掉这个的报错!
我的全局是这个名字
继续! |
2006/10/30 16:38 |
|
| 8 |
lingd |
我这里编辑时到是没有报错
只是在客户端提交记录时,报错
ERROR!Execution of a hook failed during the action Submit.
It was theACTION_VALIDATION hook attached to the Defect “Test00000036”. The reason for the failure was:
Undefined subroutine &SetDefectEmailLink called at main::Defect_Validation line 268
[ 本帖最后由 lingd 于 2006-10-30 16:55 编辑 ] |
2006/10/30 16:43 |
|
| 9 |
anthelion |
我用的系统是Cq6.15+patchs+SQLServer2000SP3
OS是Widnows2000 Advanced Server.
不知道你们用的是什么系统.
可否把操作的详细步骤写上来. |
2006/10/30 16:55 |
|
| 10 |
lingd |
听雨,你的问题可能是这个问题引起的
论坛中可能会把http的东西加上个URL,不要把论坛自动加上的东东也copy进
去掉相关的url代码应该就可以了 |
2006/10/30 17:04 |
共有评论数 38 每页显示 10
|
|