X-Ray Document Generator-Attachments

Babar Khan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 9, 2023

Hello,

I am trying to use the X-Ray document generator to create a document with issue description and to include the attachment of the issue.

The issue type is "Bug".

The attachment is normally a .jpeg file.

I would like that the .jpeg file is inserted in the generated report as the image and not a clickable icon. Is it possible? If Yes, how can I do that? 

1 answer

0 votes
Manuel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2024

That's possible.

You can render the attachments as images.

Look at this template.

In this case, "Images" would be the iterator you want as it contains only the images; see info about the mappings here.

${set(supportedImageFormats, ‘gif,jpg,jpeg,png’)}
#{if (%{'${AttachmentsCount}'.equals('0')})}
This test has ${AttachmentsCount} attachments.
#{end}
#{if (%{'${AttachmentsCount}'>0})}
File Name Author File Size (bytes)
#{for b=AttachmentsCount}
${set(extension,%{ var tmpArray='${Attachments[b].Name}'.split('.'); tmpArray[tmpArray.length - 1].toLowerCase()})}
#{if (%{',${supportedImageFormats},'.indexOf(',${extension},') == -1})}
@{title=${Attachments[b].Name}|href=${Attachments[b].FileURL}} ${fullname:Attachments[b].Author} ${Attachments[b].Size}
#{end}
#{end}
#{end}

#{if (%{'${ImagesCount}'>0})}
#{for b=ImagesCount}
@{title=${Images[b].Name}|href=${Images[b]. ThumbnailURL}}
!{${Images[b].ThumbnailURL}|width=100} ${fullname:Images[b].Author} ${Images[b].Size}
#{end}
#{end}

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events