0

是否有人已经为特定的 Quality Center 项目提供了以下查询(获取具有附件及其附件大小的所有缺陷的列表)?

查询输出:错误 ID || 附件大小(此错误的所有附件的总大小)

更新:我能够编写下面的 QTP Script/VBScript 代码来实现这一点。下面的代码有效。我必须在这里写回复,因为由于字符限制,我无法在评论部分写。此外,我找不到发布我自己问题的答案的选项。

Dim  logFileName
logFileName = "C:\TRS Files\Attachments.csv"

Set qcConnection = QCUtil.QCConnection
Set bugFactory=qcConnection.BugFactory
Set bugFilter = bugFactory.Filter

bugFilter.Filter("BG_STATUS")="Closed"
bugFilter.Filter("BG_ATTACHMENT")="Y"

Set bugList = bugFilter.NewList

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(logFileName)
Call objFile.WriteLine("BUG ID" & "," & "Collective Attachment Size")

For Each bug In bugList
            Set bugAttachments = bug.Attachments
            Set bugAttachmentList = bugAttachments.NewList("")
            Dim collectiveAttachmentSize
            collectiveAttachmentSize=0
            For Each bugAttachment in bugAttachmentList
                            collectiveAttachmentSize=collectiveAttachmentSize + bugAttachment.FileSize
            Next
            Call objFile.WriteLine(bug.ID & "," & collectiveAttachmentSize)
            Set bugAttachmentList=Nothing
            Set bugAttachments=Nothing
Next

Set objFile=Nothing
Set objFSO=Nothing
Set bugFilter=Nothing
Set bugFactory=Nothing
Set qcConnection=Nothing
4

0 回答 0