File metafield not working in shipping confirmation

Hi,

I have a problem using file metafields in the shipping confirmation template. I want to display the URL of a file attached to a product through a metafield. It’s working in the order confirmation email, but for shipping confirmation, the file metafield is not working properly.

This is what I tried:

{{ line.line_item.variant.product.metafields.download.file | json }}
{{ line.line_item.variant.product.metafields.download.file.value | json }}
{{ line.line_item.variant.product.metafields.download.file.value.url | json }}
{{ line.line_item.variant.product.metafields.download.file | file_url }}
{{ line.line_item.variant.product.metafields.download.file.value | file_url }}

metafields.download.file returns a string (e.g. “gid://shopify/GenericFile/123456789”) instead of a GenericFileDrop, so I’m not able to obtain the file URL. Using the file_url filter returns these (non-working) links:

https://cdn.shopify.com/s/files/1/0671/9140/6907/files/gid://shopify/GenericFile/123456789?439
https://cdn.shopify.com/s/files/1/0671/9140/6907/files/?439

Maybe this is a bug, because it’s working in the order confirmation? Any other ideas to get this working?

Best regards
Lukas