Use the attachment command to add an attachment to a ChangeRequest, Requirement, Task, or custom component (item types which support the attachment service)
The syntax for this command is:
attachment –p “user:pwd@host:port/project/view” [ -epwdile “pathToPasswordFile” ] –type “typeName” –id itemID
-afp attachmentFilePath [ -an “attachmentName” ] [-rmv]
-type describes the type name of the item to be shared. May be one of the stock type names, e,g,
changerequest, task, requirement, sprint, story, plan or any custom type name (which supports attachments)
-id can be either the unique item (view member) id of the item. View Member IDs are found by looking in the property lists of the cpc or can be queried using the select command, OR, the primary descriptor of the item; e.g. changerequest, task or requirement number.
-afp is the fully qualified path to the attachment on disk.
-an is an optional attachment name.
If this is not specified, then the file name will be used as the attachment name.
-rmv if specified, remove the attachment identified either by attachment name
Note that is an attachment with this name already exists, attached to this item, then the original attachment content will be replaced.
The attachment command returns the id of the newly created / updated attachment.
Note also that attachments associated with a specific artifact instance may be queried using the select command. the syntax is
select attachments from task where viewmemberid = nnn -p "user:pwd@host:port/project/view"