If you have to reference attachments in HP ALM Defects module the following script might give you a hint on how to implement it.
Source Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
' @Author - Alexander Bolte' @Changed - 2013-12-20' @Description - Returns a List object holding references to filtered Attachment objects' from given Bugs AttachmentFactory.' @Param bugger - an object of type Bug an attachment should be gotten from.' @Param fileName - a unique file name including file extension to identify ' an attachment to download.' @Returns Nothing, if it fails, else a collection of type List holding' references to filtered attachments.FunctiongetDefectAttachment(bugger,fileName)' As ListDimattachFac' As AttachmentFactoryDimattach' As AttachmentDimattachFilter' As FilterDimattachList' As ListOnErrorResumeNext' Bug object must be initialized.IfNot(buggerIsNothing)Then' Reference the bugs attachment factory.attachFac=bugger.Attachments' Get an attachment filter.attachFilter=attachFac.Filter' Setup a new filter for an attachment.attachFilter.Filter("CR_REFERENCE")="""BUG_"&bugger.ID&"_"&fileName&""""' Reference the list of filtered attachments as returned object.attachList=attachFilter.NewList()ElseattachList=NothingEndIf' Return a list object holding references to filtered attachments.getDefectAttachment=attachListIferr.Number<>0Thenerr.clear()EndIfattach=NothingattachFilter=NothingattachFac=Nothingbugger=NothingEndFunction