The code creates the field but when I open it there are no attachments listed. The listbox is empty.
There are attachments on that page. So that’s not the problem.
I am using the Atlassian SDK 6.2.15 which installs Confluence 5.10.7.
The same mimic works well for type=“spacekey” and type=“username”, only not for the attachment type.
Any idea what that could be? Do I have to import a special library in my Java class maybe?
In my experience, I have found that macro parameters are ignored if they are not all lower-case letters without any special characters. Try switching from ‘File’ to ‘file’
Hi Panos,
good idea. I ran into that “spelling” issue before. Unfortunately, in this case it did not make a difference. The listbox is still empty.
Best regards,
George
Hi David,
I didn’t find that thread before. It sounds very promising. Unfortunately, it breaks more than it fixes. After applying the suggested solution, the page editor does not load anymore or shows an empty page. Problem is the suggested Javascript as far as I can tell.
Considering that the thread is from 2012 I assume it does not applt o modern Confluence anymore.
Best regards,
George
You need the confluence-content parameter named “page”. But you can hide it.
Your attachment parameter must be named “name”. You can give it a different label in your properties file.
The above solution worked for me. The listbox contains the specified attachments. The value accessible in the Java class is the file name only though. No page ID or path.