使用VBScript在QC(HP质量中心)中启用历史记录字段

使用VBScript在QC(HP质量中心)中启用历史记录字段,vbscript,customization,hp-quality-center,Vbscript,Customization,Hp Quality Center,我试图用VBS激活QC11自定义部分中项目的历史标记。这是我的剧本: If Not voCustomization.IsLocked Then ' lock voCustomization.LockObject Print "[" & Sysdate() & "] Locked customization object." If Err.Number = 0 Then Set custFields = voCustomization.Fields ' Ma

我试图用VBS激活QC11自定义部分中项目的历史标记。这是我的剧本:

If Not voCustomization.IsLocked Then

' lock
voCustomization.LockObject
Print "[" & Sysdate() & "] Locked customization object."

If Err.Number = 0 Then

    Set custFields = voCustomization.Fields

    ' Make field searchable
    Set fcraField = custFields.Field("Test", "TS_USER_88")
    If fcraField.IsSupportsHistory Then
        If fcraField.IsHistory Then
            Print "[" & Sysdate() & "] History already set on TS_USER_88 of " & vsDomain & "." & vsProject
        Else
            fcraField.IsHistory = True
            Print "[" & Sysdate() & "] History enabled on TS_USER_88 of " & vsDomain & "." & vsProject
        End If
    End If

    ' check if the customization object has changed and commit if neccessary
    If voCustomization.IsChanged Then
        Print "[" & Sysdate() & "] Uncommited changes are waiting."
        voCustomization.Commit
        Print "[" & Sysdate() & "] Successfully commited change"
    Else
        Print "[" & Sysdate() & "] No uncommited changes are pending."
    End If

Else
    Print "[" & Sysdate() & "] Could not lock project " & vsDomain & "." & vsProject & ", abording now..."
End If 'voTDC.Customization.LockObject

' unlock
voCustomization.UnLockObject
Print "[" & Sysdate() & "] Unlocked customization object."
当我检查脚本的输出时,我可以看到它成功地连接到项目,并显示“历史记录已设置为打开…”。当我进入
定制部分>项目实体>测试>用户字段>TS_User_88
时,“历史记录”复选框未选中。我做错了什么

If custFields.FieldExists("TEST", "TS_USER_88") Then

    Set field = custFields.Field("TEST", "TS_USER_88")

    If field.IsSupportsHistory Then
         If field.IsHistory Then
                         Print "[" & Sysdate() & "] History Flag already enabled on TS_USER_88, performing no changes."
         Else
                         field.IsHistory = True
                         Print "[" & Sysdate() & "] Successfully enabled history field of TS_USER_88."

                         'Commit changes to database
                         cust.Commit()
                         Print "[" & Sysdate() & "] Changes committed to DB"
         End If
    Else
        Print "[" & Sysdate() & "] FAILED to enable hisotry field of TS_USER_88."
    End If

    Else
    Print "[" & Sysdate() & "] Project can NOT be migrated..."
    Print "[" & Sysdate() & "] FIELD TS_USER_88 NOT FOUND - PROJECT IS NOT SUPPORTED."
End If