I have created a post function with JMWE that sends an email to our customers for a certain issue type.
Everything works fine in regards to sending the email and the groovy script.
However the problem I am facing is the formatting of the email itself.
Within the Jira Customer portal and also the Jira Service Desk portal the text is formatted correct as shown below:
However the email is formatted like this:
Is there anyway for it to keep its formatting, or at least go down the page and not just have everything on the same line..
Even the Groovy text does it right:
Can anyone help? has anyone got any ideas I can try.
This is because the HTML body field expects... HTML. So you need to include the appropriate HTML formatting tags, such as <p>, <br>, <table>, etc. For example:
<table>
<tr>
<td>Staging Release:</td>
<td>${issue.get("KSD - Planned Release Staging")}</td>
</tr>
<tr>
<td>Production Release:</td>
<td>${issue.get("KSD - Planned Release Production")}</td>
</tr>
</table>
Not that multiline plain text fields can be converted to html using:
<%=TextUtils.plainTextToHtml(issue.get("Description"))%>
awesome thank you so much David, i did try that, but i thought it wasn't working because it wasn't coming out correctly when i did the Groovy Test. :-p But i saved it and whola! worked a charm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more thing you might be able to help me with, in regards to the email. is that the link down the bottom of the email which is the Ticket number, links back to the ticket in the Jira Helpdesk Section not the Customer portal. Do you know anyway of changing that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer It makes me want to cry sometimes... Everytime I step forward with this current project i'm hit the the face with another brick wall lol.
Do you know if there is anyway I can just remove the link all together?
Both the KSD-1455 link and the SPAM 2.0.0.0 link go back to our ServiceDesk side of the portal and not the customer side of the portal.
I'm talking about the below structure in the email:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not until JMWE-586. But I can provide you with a test version of JMWE 5.5.0 that already includes it, if it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah System admin didn't like that idea too much lol.
I thought maybe while we wait for the release we could just give them the correct link at the bottom of the email.
Does Jira have a variable for that?
e.g :
${issue.getURL("KSD-1455"))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, Jira doesn't have a method to return the Service Desk URL for an issue, and it's fairly difficult to get it. You can use the following Groovy Template snippet:
<%
import com.atlassian.sal.api.ApplicationProperties
import com.atlassian.servicedesk.api.portal.Portal
import com.atlassian.servicedesk.api.portal.PortalManager;
ApplicationProperties props = getComponent(ApplicationProperties)
String url = props.getBaseUrl()
PortalManager portalManager = getComponent(PortalManager)
Portal portal = portalManager.getPortalForProject(issue.projectObject).getOrNull()
if (portal == null)
return;
print url + "/servicedesk/customer/portal/"+portal.id+"/"+issue.key;
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your advice @David Fischer you've helped alot.
I ended up just creating the link using the issue.getproject() number wrapped in an html link. worked a charm :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @David Fischer !
Where should I have to run that Groovy Template snippet? We are using Jira Cloud.
Also, is there another way to get the Portal issue link?
I created a post function that send an email when a new Service Desk issue arrives, but the template contains the link to the Project issue instead of the Portal issue, so, I would like to know if there is a way I can build that URL.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brenda,
JMWE for Jira Cloud uses a different templating system - see https://innovalog.atlassian.net/wiki/x/j4CzBQ
As for getting the portal issue link (which is what the Groovy template does), it's not currently possible on the Cloud, although it will be possible in the next version of JMWE for Jira Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.