其乐融融

导航

QC中脚本开发的一些例子

QC中状态改为‘非错’要求开发人员一定写备注的脚本:

Function Defects_Bug_CanPost

    On Error Resume Next

    if (Bug_Fields("BG_STATUS").IsModified and _

         Bug_Fields("BG_STATUS").Value = "非错" and _

            not Bug_Fields("BG_DEV_COMMENTS").IsModified) and _

                       (User.IsInGroup("项目经理") or _

             User.IsInGroup( "开发人员"))    then

        Defects_Bug_CanPost = False

        msgbox "请在注释中加上非错说明"

        Else

        Defects_Bug_CanPost = True

        End If

    On Error GoTo 0

除了TD管理员外,只有提缺陷的人才能最终关闭该缺陷:

Sub Defects_Bug_FieldChange(FieldName)
    On Error Resume Next
    if  User.IsInGroup( "TDAdmin")   then
      else
            If FieldName = "BG_STATUS" Then
                 if (Bug_Fields("BG_STATUS").Value = "Closed" and Bug_Fields("BG_DETECTED_BY").Value <> User.UserName)  then
                         msgbox "只有该缺陷的创建人才能进行关闭",48,"警告"
                         msgbox  (PreviousStatus)
                          Bug_Fields("BG_STATUS").Value = PreviousStatus
                  end if
            end if
    end if
    On Error GoTo 0
End Sub

posted on 2009-10-16 11:35  黑白酉己  阅读(1060)  评论(0编辑  收藏  举报