您的位置:首页 > 其它

[QualityCenter]设置工作流脚本-缺陷字段值发生变化时的处理

2016-04-21 10:45 309 查看
需求:缺陷状态发生不同变化时,系统会的自动处理一些字段值的变化

在脚本编辑器找到Defects_Bug_FieldChange函数,然后填写以下代码:

Sub Defects_Bug_FieldChange(FieldName)

’已打回状态时,自动弹出要求填写注释,并将“分配给”的值置为“检查者”的值

If Bug_Fields("BG_USER_06").IsModified and _
Bug_Fields("BG_USER_06").Value = "3.已打回" then
msgbox "请在注释处标明原因!"
Bug_Fields("BG_RESPONSIBLE").Value = Bug_Fields("BG_DETECTED_BY").Value

’待沟通状态时,自动弹出要求选择下一环节的负责人

ElseIf Bug_Fields("BG_USER_06").IsModified and _
not Bug_Fields("BG_RESPONSIBLE").IsModified and _
Bug_Fields("BG_USER_06").Value = "5.待沟通" then
msgbox "请选择下一环节负责人!"
Bug_Fields("BG_USER_07").IsRequired=true

’已关闭状态时,要求填写关闭版本号,轮次号等,并自动填写关闭日期和计算缺陷处理时间

ElseIf Bug_Fields("BG_USER_06").IsModified and _
Bug_Fields("BG_USER_06").Value = "6.已关闭" then
Bug_Fields("BG_CLOSING_VERSION").IsRequired=true
Bug_Fields("BG_USER_12").IsRequired=true
Bug_Fields("BG_USER_01").IsRequired=true
Bug_Fields("BG_USER_07").IsRequired=true
Bug_Fields("BG_CLOSING_DATE").Value=Date()

Bug_Fields("BG_USER_16").Value= DateDiff("d",Bug_Fields("BG_DETECTION_DATE").Value,Date())

End if

End Sub

以上只是列举其中一些例子和用法, 不详细列举所有用法,希望大家能够举一反三。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: