---
title: "Copy attachment(s) with a specific word in the file name"
canonical: "https://support.appfire.com/space/JMWEC/466257749/Copy%20attachment(s)%20with%20a%20specific%20word%20in%20the%20file%20name"
format: markdown
---
> Macro (aura-html)

This article provides the code snippet to copy attachment(s) that have a specific word in the file name from the current issue to other issue(s) using [https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465504849](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465504849)  post-function

## \uD83D\uDCD8 Instructions

1. Navigate to the intended workflow to make the necessary changes in the edit mode.
2. Select the required transition.
3. Select the *Post functions *tab and click `Add post function`.
4. Add the [https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465504849](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465504849) post-function.
5. Select the issues, for which the attachments should be copied, under “Target Issue(s)”.
6. Select the “Attachment” field and add the below Nunjucks template:
  Replace the word `test` in line #3 with the desired word.
7. Select the “Treat value as JSON” option (select/unselect other options as per your use case)

With this, the attachment(s) that contain the word `test` (modify it) in the filename are copied from the current issue to the configured target issue(s) 

![JMWE for Jira Cloud attachment copying configuration with filename filtering options](media://aaaaddbb-7898-4578-99b8-2a55c9ce452a)


> ℹ️ If this post-function is added on the create transition, select the checkbox *“Delay the execution of this post-function”* under *“Delayed execution” *and select a delay of 3 seconds.

### References

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [Accessing JIRA Standard fields](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466225701)
- [Tags and Expressions](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466322168)
- [field filter](/wiki/spaces/JMWEC/pages/78482118)
- [dump filter](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373240/Nunjucks+Filters#dump)

## \uD83D\uDCCB Related articles

> Macro (contentbylabel)