Send a custom email - Error

I performed several tests on appeal "Send a custom email" in "Script Runner Builtin" it works for viewing and sending email. But when I insert the script in "Post-Function" in Transition "Create Issue" it does not send e-mail and returns no error.

Here are the codes used

Condition: ['Blocker']. Contains (issue.priority '. Name)

Email template: The $ $ issue.issueType.name issue.key was created with priority <% Out << issue.priority '. Name%>. <br>

Summary: $ {} issue.summary <br>

Responsible: $ {issue.assignee '. Name}

Subject template: The Bug Blocker: $ issue was created | DISCLAIMER |

Email format: HTML

To addresses: e-mail address

What could be wrong?

3 answers

1 accepted

This widget could not be displayed.

I think you will need to change it so that:

$issue.issueType.name $issue.key

looks like:

<% out << issue.issueType.name < " " < issue.key %>

That is, for what you've done with the priority do the same with the other fields.

The problem is that OSWorkflow tries to be clever and converts any args with a $ in to a field and substitutes a null.

O &lt;% out &lt;&lt; issue.issueType.name &lt; " " &lt; issue.key %&gt; foi criado com a prioridade &lt;% out &lt;&lt; issue.priority?.name %&gt;. &lt;br&gt;
Resumo: ${issue.summary} &lt;br&gt;
Responsável: ${issue.assignee?.name}

Jamie,

Now is giving syntax error

You still haven't changed the last two lines. Use the email test in Admin -> Built-in scripts. Build it up step by step starting from something that works.

Condition:
['Closed'].contains(issue.status?.name)

Email template:
A ${issue.key} foi finalizada. &lt;br&gt;
Resumo: ${issue.summary} &lt;br&gt;
Responsável: ${issue.assignee?.name}

I tested this in another post of Transition Functions: Close Issue and neither worked.
Below the screens of Builtin Script Runner (that works and even sends e-mail) and the code in Post Functions (which does not work and does not send e-mail).

This widget could not be displayed.
Henning Tietgens Community Champion Mar 19, 2013

Could you copy & paste your code to a code block using the code icon of the editing area? It looks a little bit messed up in the current way.

Henning

This widget could not be displayed.
O $issue.issueType.name $issue.key foi criado com a prioridade &lt;% out &lt;&lt; issue.priority?.name %&gt;. &lt;br&gt;
Resumo: ${issue.summary} &lt;br&gt;
Responsável: ${issue.assignee?.name}

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

527 views 3 19
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you