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?
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}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.