提供思路两种思路:1、触发状态时,取当前bug各个字段值,直接往数据库中插一条新的。
2、触发状态时,取当前bug各个字段值,new新bug,赋值,提交。(模拟操作过程)
都要查查QC开放指南。。。。。。。楼主可自行研究。作者: yeshaolin 时间: 2012-7-3 15:07
非常感谢wower1985
我在网上找了一段代码:但试了以后没有效果。
Bug.post环节会卡很久,但无法new出新的defect, 请高人指点下 多谢了!
例子如下:
Dim QCConnection
Set QCConnection = QCUtil.QCConnection
if QCConnection.Connected then
msgbox("connect successfully")
end if
'Get the IBugFactory
Set BugFactory = TDConnection.BugFactory
'Add a new empty bug
Set Bug = BugFactory.AddItem (Nothing)
'fill the bug with relevant parameters
Bug.Status = "New"
Bug.Summary = "Connecting to TD"
Bug.Priority = "4-Very High" ' depends on the DB
Bug.AssignedTo = "admin" ' user that must exist in the DB's users list
Bug.DetectedBy = "admin" ' user that must exist in the DB's users list
'Post the bug to DB ( commit )
Bug.Post作者: wower1985 时间: 2012-7-3 17:13
你写的这个可能可以,但是完全搬到你这来可能就运行不通过了,具体原因不想找了,我写的:
Sub Defects_Bug_FieldChange(FieldName)
On Error Resume Next
if Bug_Fields.Field("BG_STATUS").IsModified then
Set Bug = BugFactory.AddItem (Nothing)
Bug.Status = "New"
Bug.Status = "已关闭"
Bug.Summary = "测试测试测试测试"
Bug.Priority = "3-中"
Bug.AssignedTo = "test"
Bug.DetectedBy = "test"
Bug.Post
Set Bug=nothing
end if
On Error GoTo 0
End Sub