Send a custom email - Error

Daniel Farias March 19, 2013

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

0 votes
Answer accepted
JamieA
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.
March 20, 2013

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.

Daniel Farias March 20, 2013
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

JamieA
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.
March 20, 2013

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.

Daniel Farias March 20, 2013
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).

0 votes
Daniel Farias March 20, 2013
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}

0 votes
Henning Tietgens
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.
March 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events