0

How do I programmatically determine if a defect in HPQC (Now HP ALM) has an attachment?

if(bug.HasAttachment){
  //do stuff
}

doesn't seem to be working...

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51

1 Answers1

0

That is the correct function to determine if a bug object has an attachment and it works for me in VBA.

I assume your bug object has been properly initialised? Has the attachment been incorrectly added to one of the bug's linked entities instead?

Try getting a count of the attachments instead?

Dim AttachmentList As List
Set AttachmentList = MyBug.Attachments.NewList("")
If AttachmentList.Count > 0 Then
    //do stuff

There's not a lot of information in the question to go on...

Brian
  • 46
  • 2