在改变BUG的状态为Fixed的时候,如何要求强制添加注释信息(转自论坛)

上一篇 / 下一篇  2009-08-10 13:53:43 / 个人分类:QC

注意:
1. 代码是在自定义->set up workflow中定义的,
2. 请找到相关的function进行修改。需要具备一定vb代码基础。
3. 不光是Fixed状态,大家可以灵活运用,根据自己的需要
4. 我本人已经试过没有问题.
最后,代码是一行一行整理的,大家要珍惜啊


' variable global to defect module
dim CommentFieldFlag

FunctionDefects_Bug_CanPost  
On Error Resume Next
' checks for Status of "Fixed" and comments flag = true else allows the user post defect
    If Not Bug_Fields("BG_BUG_ID").IsNull AND Bug_Fields("BG_STATUS").Value = "Fixed" Then
        If CommentFieldFlag = True then
          Defects_Bug_CanPost = True
        Else           
          Defects_Bug_CanPost = False
          MsgBox "please add a comment (using the Add Comments button) with informationabout the fix.",VbInformation  ,"No Comment Warning"      
        End If
     Else      
         Defects_Bug_CanPost = True  
     End If
'comment out or delete thisnextline if there by default
'Defects_Bug_CanPost = Project_DefaultRes
On Error GoTo 0
End Function


Sub Defects_Bug_AfterPost  
   On Error Resume Next
  ' resets the flag after each defect is posted
   CommentFieldFlag = False
   On Error GoTo 0
End Sub



Sub Defects_EnterModule  
    On Error Resume Next
  ' initialises flag   
   CommentFieldFlag = False
  On Error GoTo 0
End Sub



Sub Defects_Bug_FieldChange(FieldName)  
On Error Resume Next
' sets flag for comments when comments updated
   If FieldName = "BG_DEV_COMMENTS" then
          CommentFieldFlag = True
   End If
  On Error GoTo 0
End Sub

TAG:

 

评分:0

我来说两句

Open Toolbar