It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA Service Desk Attachments

Morning All

Hope someone can help.

We have started to use JSD but not via the portal, customers send in requests via email. When i put an attachment on a ticket and the customer gets the email notification back with the attachment, the link for the attachment seems to indicate they need access to the portal which currently they dont have. So they cant actually view/download the attachment.

Any ideas, thanks.

J

6 answers

1 accepted

3 votes
Answer accepted

Hi John,

JSD email notifications to customers that contain attachments require the customer to click a link and login to view the attachment, currently there is no built in way to attach the issue attachment to the email itself. A suggestion is already open with Atlassian to implement this: JSDSERVER-3371

Currently the only way to attach the file to the actual email is via a third-party mail handler plugin such as JEMH (I work for the vendor) which is capable of gathering all the relevant issue attachments and attaching them directly to email notifications.

Kind Regards,

Reece

thanks for the reply

hi, it seems this workaround does not work

does it work for you ?   

sorry I had to replay to the next message

JEMH is a replacement for the built in Jira Service Desk notifications, simply installing JEMH will not be enough to get attachments attaching directly to emails. You will need to configure JEMH so that all of your JSD notifications are sent via JEMH.

A quick start guide for JEMH can be found here: JEMH Quickstart Guide

Support for the product is available via: support@thepluginpeople.com

Hi John;

Workaround : Do not use "space" or characters like  (+%&/-) in the attachements/files name.

 

Br

Have you tried a cheap "Email this issue" add-on?

Apart from the other replies, you can also use Mail Attachments for JIRA Service Desk that has been released exclusively to address this problem:

https://marketplace.atlassian.com/apps/1219283/mail-attachments-for-jira-service-desk?hosting=server&tab=overview

@Jose León Serna this addon still displays a link to the portal (in the e-mail send to the customer). Rendering it useless.

Really? Then I am unsure it fits my needs anyway. On the atlassian marketplace it says: "All attachments are included as an actual e-mail attachment within the e-mail notification so that the attachment can be downloaded directly from the e-mail without having to login to the instance."
But should it be understood in the way that there is a link that allows you to download it, but you will have to press the link to do so? It is not just "in" the e-mail just as if I sent a mail to you with an attachment in?

Like Alexander Drobyshevsky likes this

I cannot speak for the other app mentioned above but JEMH does attach the attachments to notification emails directly as you describe, you would need to switch to using JEMH for your Service Desk notifications to achieve this.

Hi all,

 

You can add regular files and inline attachments (to comment) to email notification using our add-on Raley Email Notification

Here's an article explaining how to do that

Hi!

We faced with the same problem and found no good solution better than the dirty trick, described below. Do not do it if you are not sure! Also the solution assumes there is no sensitive data in the attachments, as it bypasses the access control completely.

Our Jira Service Desk runs on Ubuntu+Apache2 and stores the attachments in /var/atlassian/application-data/jira/data/attachments/HELPD (HELPD is service desk application name)

1. Add www-data user to jira group: 

sudo usermod -a -G jira www-data

2. Create a symbolic link to the attachments dir from somewhere else: 

ln -s /var/atlassian/application-data/jira/data/attachments/HELPD /var/www/helpdesk_attachments/

3. Some sub-directories in /var/atlassian/application-data/jira/data/attachments/HELPD path are accessible for jira user only. Check all subdirs and change their permissions (if needed) with

chgrp jira /var/atlassian/application-data/jira/

chmod 750 /var/atlassian/application-data/jira/

 

Now you should be able to list attachments file structure with a command like

ls -R /var/www/helpdesk_attachments/*

 

4. In apache2 config of your site add the lines (it assumes Jira is configured with /jira URL prefix):

ScriptAlias "/jira/secure/attachment" "/var/www/helpdesk_attachments/index.php"

ProxyPass /jira/secure/attachment !

before 

ProxyPass /jira http://localhost:8040/jira
ProxyPassReverse /jira http://localhost:8040/jira

5. Create PHP script /var/www/helpdesk_attachments/index.php with the content

<?php

$pieces = explode("/", $_SERVER['REQUEST_URI']);
$size = sizeof($pieces);
$files = glob(getcwd() . "/*/*/*/" . $pieces[$size-2]);

$filepath = $files[0];

if(file_exists($filepath)){

$filename = $pieces[$size-1];
$prefix = $pieces[$size-2] . '_';
$filename = preg_replace("/^$prefix/", '', $filename);
$mime = getMime($filename);

  header('Content-Type: ' . $mime);
    header('Content-Disposition: attachment; filename=' . $filename);

    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');

    header('Content-Length: ' . filesize($filepath));

    ob_clean();
    flush();
    readfile($filepath);
    exit;
}

function getMime( $filename ) {
$types = array(
    'ai'      => 'application/postscript',
    'asc'     => 'text/plain',
    'avi'     => 'video/x-msvideo',
    'bin'     => 'application/octet-stream',
    'bmp'     => 'image/bmp',
    'class'   => 'application/octet-stream',
    'css'     => 'text/css',
    'csv'     => 'text/csv',
    'doc'     => 'application/msword',
    'dtd'     => 'application/xml-dtd',
    'eps'     => 'application/postscript',
    'gif'     => 'image/gif',
    'htm'     => 'text/html',
    'html'    => 'text/html',
    'ico'     => 'image/x-icon',
    'jpeg'    => 'image/jpeg',
    'jpg'     => 'image/jpeg',
    'js'      => 'application/x-javascript',
    'json'    => 'application/json',
    'mathml'  => 'application/mathml+xml',
    'mov'     => 'video/quicktime',
    'mpeg'    => 'video/mpeg',
    'mpg'     => 'video/mpeg',
    'pdf'     => 'application/pdf',
    'png'     => 'image/png',
    'ppt'     => 'application/vnd.ms-powerpoint',
    'ps'      => 'application/postscript',
    'qt'      => 'video/quicktime',
    'rtf'     => 'text/rtf',
    'svg'     => 'image/svg+xml',
    'svgz'    => 'image/svg+xml',
    'swf'     => 'application/x-shockwave-flash',
    'tar'     => 'application/x-tar',
    'tif'     => 'image/tiff',
    'tiff'    => 'image/tiff',
    'tsv'     => 'text/tab-separated-values',
    'txt'     => 'text/plain',
    'xhtml'   => 'application/xhtml+xml',
    'xls'     => 'application/vnd.ms-excel',
    'xml'     => 'application/xml',
    'xsl'     => 'application/xml',
    'xslt'    => 'application/xslt+xml',
    'zip'     => 'application/zip',
    'eml'     => 'message/rfc822'
);

$path_info = pathinfo($filename );
$ext = strtolower($path_info[extension]);
$mime = $types[$ext];
if ( $mime === null ) {
$mime = "text/plain";
}

return $mime;
}

?>

In the code there is a redundant getMime() implementation. For some reason on our system the standard PHP's mime_content_type() does not work, so it was easier/safer not to troubleshoot the prod system, but to implement a minimalist replacement.

6. Add error handling to the index.php if you find it is needed.

7. restart Apache with sudo service apache2 restart

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Service Desk

Tell us how you've implemented Change Management

Hello Community 👋, I'm a product manager at Atlassian, looking at improving change management capabilities across our products. In particular, we're looking at bridging the gap between Dev & ...

485 views 0 10
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you