getAttachment
Retrieves an attachment from an item or a workflow event on an item. A SOAP error envelope is returned if the operation fails.
Parameters
| Parameter | Type | Description |
|---|---|---|
| cookie | long | Session cookie returned by projectLogon. |
| tablename | string | Table name the item belongs to. Valid values: Defect, Test Case, Test Run, Requirement, Requirement Document, Test Variant, User, Customer, Task, Test Config, Links, Folder, and Report. Use getTableList to retrieve a list of available tables. |
| recordID | long | Unique item record ID. |
| eventID | long | Unique workflow event record ID. Set to 0 if an event’s attachments should not be retrieved. |
| pszArchiveName | string | Archive name of the attachment in the Helix ALM database. |
Return value
| Value | Type |
|---|---|
| pAttachment | CFileAttachment |
Example
CDefect def = ttsdk.getDefect(cookie, 0, "Defect summary", false);
foreach (CFileAttachment file in def.workaroundInlineAttachList)
{
CFileAttachment fAttach = ttsdk.getAttachment(cookie, "Defect", 1, 0, file.mstrArchiveName);
mySaveFileAttach(fAttach.mstrFileName, fAttach.mpFileData);
}