对于特定的Quality Center项目,是否有人拥有以下查询(获取具有附件及其附件大小的所有缺陷的列表)?
查询输出: 错误ID ||附件大小(此错误的所有附件的集体大小)
更新: 我能够编写下面的QTP脚本/ 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