Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding pdf preview to JIRA issue

Mikolaj Bialko March 22, 2018

I'm trying to build an automated process for invoice acceptance for my company. So when an e-mail with attached invoice arrives at a specific mailbox, a JIRA issue with attachment is created. However, when someone has to accept dozens of invoices, clicking every time to open pdf attachment preview is a bit mundane. So I'd like to have a pdf preview embedded in JIRA issue view. I know it's possible in comments, using HTML

{html}<embed src="./test.pdf" width="500" height="375" type='application/pdf' />{html},

but it's not automated and using HTML in comments is not the best way as far as I know. Using wiki markup !test.pdf|width=500,height=375! works fine with images, but with pdfs it returns an error Unable to embed resource: test.pdf of type application/pdf. And - again - it's not automated. 

I suppose the best way would be to use custom plug-in with js script, but I would have to somehow filter all pdf attachments from the issue. And I never wrote anything in js.

Any help and suggestions appreciated. Thanks in advance!

1 answer

0 votes
Randy
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.
April 6, 2018 edited

you can do this with light scripting:

 

  1. add a custom field to represent the preview
  2. set the field render to html (wont work on cloud but i'm assuming you're on server since html in comments works).  Do this by creating a new field configuration and scheme
  3. set the value of the custom field to the html example you showed that worked in comments via script

Suggest an answer

Log in or Sign up to answer