confluence attachments auto label
Asked by Rick Breidenstein:

Is it possible to auto label documents that are uploaded via the attachment macro that is filtering by label?


Answers:
author: Thom
body: It is possible with the attachment macro, but only when you use the browse option. In the macro settings you define the labels you want to filter by, and allow upload. Note that the labels have to exist already. When you upload files they automatically get the labels.  
There are open issues on the drag and drop feature:

<https://jira.atlassian.com/browse/CONF-33902>

<https://jira.atlassian.com/browse/CONF-37724>

I was hoping to find a solution here. We want to use macro's like content by label, recently updated, livesearch to find content, but can't really use those because not all content is found when users drag and drop files. So hopefully this will get fixed soon! Please vote for the issues!

(We are using Confluence Server 5.7)

comments: author: Ian
body: [@Thom](/t5/user/viewprofilepage/user-id/538028) Were you able to get a solution to your problem because I have similar task?


author: Thom
body: Hi Ian,

Unfortunately not when you use drag \& drop, only when you manually browse and upload your file. But this issue seems to be fixed for Confluence Cloud and might also get a fix for Confluence Server (see <https://jira.atlassian.com/browse/CONFCLOUD-53570>).


author: Rick Breidenstein
body: I agree. I was hoping I just missed a check box somewhere :-(

comments: author: Eric Brahmann
body: Auto Labeling would be pretty cool -\> An easy Option like "Use same Labels as Parent Page" or similiar would be great


author: Andreas Purde
body: Dear all,

for those who can't wait until Atlassian is willingly to fix it: I added a small app to the Marketplace which closes the gap: [https://marketplace.atlassian.com/apps/1220787/attachment-boxes?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/1220787/attachment-boxes?hosting=server&tab=overview). It is [open source](https://bitbucket.org/apurde/attachment-boxes) in case you need to adopt it.

Kind regards Andreas


author: Eric Brahmann
body: I am using not the "attachements" macro and adding labels there. If uploading via "browse for files", it attaches those labels :-)

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/16324i6FACCC99B737F200/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/16325i3ED01528DA2D7338/image-size/large?v=v2&px=999 "image.png")

comments: author: Ian
body: [@Eric Brahmann](/t5/user/viewprofilepage/user-id/1179334) I got it working with confiforms with the help of [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)


author: Dan Bishop
body: [@Ian](/t5/user/viewprofilepage/user-id/1168955), would you be able to share your solution?

We use Confiforms in our organization and would like to be able to auto label attachments for a number of our forms.


author: Ian Magero
body: [@Dan Bishop](/t5/user/viewprofilepage/user-id/772775) Please update confiform to the lastest version and then you will need to configure an IFTT macro.

How I configured it is as follows:

1.Event I selected on Create.

2.Action will be Add attachment Label.

3.Attachment ID to move (or IDs, comma separated) - \[entry.myfiles.asAttachments.transform(id).asList\]. My file upload input field is called myfiles hence you will replace it with you file input field name.

4.Labels - \[entry.country.transform(co).asList\] - co is the name of the key of my dropdown.

How the form works is a user will be able to upload an attachment and select the countries.The attachment will be labelled with the countries the user has selected.


author: Dan Bishop
body: I'll engage our Admins to update to the latest version as I do not see the "Add Attachment Label" option within the IFTTT macro. Once updated I'll give this a try.

Appreciate your response!

Thanks,

Dan


author: Davin Studer
body: That would be a pretty slick feature if it did that.


author: Alex Medved _ConfiForms_
body: I do not think this is possible with standard macro, but you can develop your custom listener (<https://developer.atlassian.com/display/CONFDEV/Event+Listener+Module>) and catch for <https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/event/events/content/attachment/AttachmentCreateEvent.html> events (and label attachments as you need)