Dear all,
I have a question on the custom email sent from Listeners in Jira.
We have X field of the multiline text type and it's default vale is set through the Behaviour that cretaes a template that contains table. You can check its visual representation (the way it shows on the view screen) in the TableVisual and its row version (how its default value is set) in the TableRaw screens attached.
Then any time the tabel is updated the idea is to send a custom email using Listener Send custom email when Issue is updated based on the following condition:
def change = changeItems.find {it.field == "X field"}
if (change) {
def oldValue = change.oldstring
def newValue = change.newstring
}
Emailtemplate is as follows:
Dear all,
The table has been updated.
<%
def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field == "Additional Information"}
if (change) {
out << 'Old: ' + "\n\n" + change.oldstring + "\n\n"
out << 'New: ' + "\n\n" + change.newstring
}
%>
Thank you!
As you can see I want to send the X field (table) the way it looked before and after the update.
The problem is that in the email the table looks as its row version. See the screen shot below:
Is there any way to make it look as the table from the visual screen within the email?
Thank you,
Iryna
I'm not familiar with how to do this in script runner, but this is fairly simple with Jira Automation:
In your send email action you would add this to the body
{{issue.customfield_xxxxx.html}}
hi @Mark Segall
Thank you for the reply. We dont use triggers, and also field will be updated and therefore the email will be sent regardless of the status.
Best,
Iryna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Iryna Pazharytskaya - I was speaking to using Jira Automation instead of script runner. You can add a condition for status. This type of rule can be set up in just a couple minutes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark Segall ,
Do you mean Listener? Also as I have been investigating further on my issue, what actually have is a Wiki renderer field that contains a table (using ||||). It looks nice and all, but I am still struggling to implement it in the email, it looks like a raw html version even if I use
{{issue.customfield_xxxxx.html}}
format. I also tried using it within Listener and it doesn't work.
Iryna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Iryna Pazharytskaya - I was referring to automation for Jira which is a built-in functionality of Jira, independent of script runner. If you prefer to handle this in script runner, I'll need to defer to someone else in the community to assist on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark Segall
I figured out how to use it in the srcipt runner Listener. But I still need to be able to use it within the Send email post function. So if you have some tips I would appreciate it.
Thank you,
Iryna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.