Send Custom Email add Create date within email

Jenifer Kuntz March 23, 2015

I have a custom email that is being sent on resolution using the Script Runner Send Custom Email post function.

With in the email, I want to include the Created Date.  I tried using issue.createdDate and issue.created.date neither worked.  What do I need to use to get the date in the email?

Thank you!
Jenifer 

3 answers

1 accepted

2 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 25, 2015

This is a rare occasion when you cannot use the property syntax - see my comment here: https://answers.atlassian.com/questions/251026/script-runner-how-do-i-pull-created-date-information-from-an-issue

Also, because OSWorkflow mangles the parameters, you need to do:

<% out << issue.getCreated() %>

Jenifer Kuntz March 26, 2015

Thank you! That worked, The date is showing date and time, annyway to to only show the date? Search is frustrating, I searched on Created Date and the question did not come up.

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 26, 2015

issue.getCreated().format("dd-MMM-yy")

Jenifer Kuntz March 26, 2015

Awesome! Thank you so much!

Randee024 January 5, 2018

is it possible to send a custom email with different recipient. i mean changing them(recipient) is possible? 

0 votes
Philippe Aubin
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 24, 2015

Maybe we should raise a flag for this issue, i have tryed all property of the com.atlassian.jira.issue Class IssueImpl.

Everyone of them give me an error like this: 

 

11111.png

0 votes
Philippe Aubin
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 23, 2015

Have you tried : 

$issue.getCreated()

 

Jenifer Kuntz March 23, 2015

It is telling me the same thing - No such property: getCreated for class: com.atlassian.jira.issue.IssueImpl

Philippe Aubin
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 24, 2015

You are correct, sorry should have tested that before hand. Only one that work for me is $issue.created but it return : True and not a date. I will continue to try and make this work. Unless someone else find a solution before me

Alejo Villarrubia [Adaptavist]
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 24, 2015

Which version of Jira are you using?

Jenifer Kuntz March 24, 2015

We are on 6.3.12

Alejo Villarrubia [Adaptavist]
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 24, 2015

Suggest an answer

Log in or Sign up to answer