Jira Workflow Transition - Send Attachment

AccessHolding August 27, 2018

Dear Community,

I have an simple workflow there the reporter needs to fullfil an excel sheet. Ideally the transition from status A to B will send an email with this sheet as attachment to the reporter.

Any ideas how to archieve? Maybe with scriptrunner? Best would be without any other plugins.

Thanks in advanced.

Kristian

2 answers

2 votes
Krisztian Kovacs
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.
August 27, 2018

Hi @AccessHolding,

if I'm not wrong (and I often am) I'd say you need a custom scriptrunner email script or you could use the Email this issue add-on: https://marketplace.atlassian.com/apps/4977/email-this-issue?hosting=cloud&tab=overview

JETI can send out recent attachments.

Regarding the archiving: what do you mean by that?

Solution without add-ons: you would have to redirect the user to your Jira issue and open up your Jira to public.

Let me know if this helps somewhat and what your additional thoughts are.

Cheers,
Krisz

Dave Bosman _Realdolmen_
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.
August 27, 2018

I think he means achieve. instead of archiving. 

Krisztian Kovacs
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.
August 27, 2018

@Dave Bosman _Realdolmen_ thanks, that does make sense, good point - silly me.

AccessHolding August 27, 2018

Hi @Krisztian Kovacs,

Thanks for the mentioned hints. For scriptrunner itselfs it looks like the custom email function is for configuring attachement rules only or I miss the simple "upload attachement" button. :)

Yes you are right, to add an attachment as a comment for example and just inform the user could be also an option. Looks like this is the way to go for me. Thanks for helping out, which I appreciate.

Best,

Kristian

2 votes
Mark Markov
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.
August 27, 2018

Hello @AccessHolding

You can use Script Runner post-function on this transition called "Send custom email" there are option to include attachments added during this transition.

Снимок экрана 2018-08-27 в 14.15.14.png

AccessHolding August 27, 2018

Thanks @Mark Markov,

This helps me at least for customizing the e-mail even further but where can I upload the attachement when? It seems this area is for setting rules only. Like upload .pdf´s only or to restrict the filesize.

I want to archieve for example that I press the transition action and a custom email with an attachment X will be send automatically. The reporter needs to fullfil this attachment, re-upload and done.

Thanks in advanced.

Kristian 

Mark Markov
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.
August 28, 2018

In this case, for example, you can attach this excel to issue, and create custom callback that will attach files with given name

import com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.MailAttachment

{MailAttachment a -> a.filename.toLowerCase().equals("exeltofill.xls")}
Jorge Jerez August 1, 2019

Hi

 

We use 

com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.MailAttachment

Actually in our Jira instance, but in our plan to upgrade to Jira 8 this script is not working, do you know where we can find the new class for this? 

BigBabba August 22, 2019

The import moved:

import com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.mail.MailAttachment;

Like Alexander likes this

Suggest an answer

Log in or Sign up to answer