需求:缺陷状态发生不同变化时,系统会的自动处理一些字段值的变化

 

在脚本编辑器找到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

以上只是列举其中一些例子和用法, 不详细列举所有用法,希望大家能够举一反三。

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2021-11-19
  • 2021-07-11
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2021-09-24
  • 2021-06-02
  • 2022-01-16
  • 2021-10-09
  • 2022-12-23
  • 2021-06-15
  • 2022-01-28
相关资源
相似解决方案