Defects module script
Sub Bug_FieldChange(FieldName)
On Error Resume Next
'open bug时:优先级、责任人必填,自动指派给架构师(songmj)
If (User.IsInGroup("项目负责人及仲裁") and _
Bug_Fields("BG_STATUS").IsModified and _
Bug_Fields("BG_STATUS").Value = "Open" )then
Bug_Fields("BG_PRIORITY").IsRequired = True
Bug_Fields("BG_USER_07").IsRequired = True
Bug_Fields("BG_RESPONSIBLE").Value = "songmj"
Else
Bug_Fields("BG_PRIORITY").IsRequired= False
Bug_Fields("BG_USER_07").IsRequired= False
End If
'Fix bug时:解决方案、解决版本必填;解决者默认为当前登录用户;指派者,默认为发现者
'解决时间默认为当前时间
If (User.IsInGroup("开发") and _
Bug_Fields("BG_STATUS").IsModified and _
Bug_Fields("BG_STATUS").Value = "Fixed") then
Bug_Fields("BG_USER_06").IsRequired = True
Bug_Fields("BG_USER_01").IsRequired = True
Bug_Fields("BG_USER_02").Value = User.UserName
Bug_Fields("BG_RESPONSIBLE").Value = Bug_Fields("BG_DETECTED_BY").Value
Bug_Fields("BG_USER_08").Value = now()
Else
Bug_Fields("BG_USER_06").IsRequired = False
Bug_Fields("BG_USER_01").IsRequired = False
End If
'reopen bug时:指派者默认为解决者、责任人默认为解决者
If (User.IsInGroup("TDAdmin") and _
Bug_Fields("BG_STATUS").IsModified and _
Bug_Fields("BG_STATUS").Value = "Reopen")then
Bug_Fields("BG_RESPONSIBLE").Value = Bug_Fields("BG_USER_02").Value
Bug_Fields("BG_USER_07").Value = Bug_Fields("BG_USER_02").Value
Else
End If
'close bug时:加关闭时间字段,默认为当前时间(系统自带);
'加关闭者字段,默认为当前用户 ;指派者,默认为closed
If(User.IsInGroup("TDAdmin") and _
Bug_Fields("BG_STATUS").IsModified and _
Bug_Fields("BG_STATUS").Value = "Closed" )then
Bug_Fields("BG_USER_09").Value = User.UserName
Bug_Fields("BG_RESPONSIBLE").Value = "Closed"
Else
End If
PrintError "Bug_FieldChange"
On Error GoTo 0
End Sub