---
title: "copyAttachment"
canonical: "https://support.appfire.com/space/PSCONF/15307061/copyAttachment"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | copyAttachment(srcPageId, attachmentName, dstPageId) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Copies an attachment from one page to another.

Copies an attachment from one page to another.

## Return Type

**Boolean (true/false) **

## Example

```javascript
copyAttachment(11800, "attachmentToCopy.txt", 11801);
```

Returns true if the attachment was copied successfully and false otherwise. If returned false check the log for a detailed reason on why it failed.

> ⚠️ If you have multiple attachments on an issue with the same file name, all of them will be copied.

## See also

> Macro (contentbylabel)