Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Table borders not rendering

Joseph
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2023

Hi, guys

 

I'm Joseph and meet a huge problem (for me at least...)

I had sended email through 'Send a custom email' in workflow.

Recently, I found a way to send email through 'Custom script post-function' and prefer it.

But, some rendering issue is in 'Custom script post-function(Case 2)'. That is, I can't see the border line in email when I input a table into Issue Description Field. (table form is rendered well except border line) 

 

Here is my codes, both works. 

//Case 1 : Send a custom email 

---------------------------Configuration

import com.atlassian.jira.component.ComponentAccessor as ca
import com.atlassian.jira.issue.RendererManager
import com.atlassian.jira.issue.fields.renderer.IssueRendererContext
import com.atlassian.jira.issue.fields.renderer.JiraRendererPlugin


def rdm = ca.getComponent(RendererManager) // RendererManager
def wikiRenderer = rdm.getRendererForType("atassian-wiki-renderer")
def rendererContext = new IssueRendererContext(issue)

config.desc = wikiRenderer.render(issue.description, rendererContext)


--------------------------- Body Template
${desc}

// it works well for border line

 

//Case 2 : Custom script post-function

import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer

import com.atlassian.jira.issue.RendererManager
import com.atlassian.jira.issue.fields.renderer.IssueRendererContext
import com.atlassian.jira.issue.fields.renderer.JiraRendererPlugin

import com.atlassian.jira.component.ComponentAccessor as ca


def rdm = ca.getComponent(RendererManager)
def wikiRenderer = rdm.getRendererForType("atassian-wiki-renderer")
def rendererContext = new IssueRendererContext(issue)


def desc = wikiRenderer.render(issue.description, rendererContext)

def Body = """${desc}"""


STMPMailServer mailserver = ca.getgetMailServerManager().getDefalutSMTPMailServer()
Email email = new Email("...@...")
email.setSubject(title)
email.setBody(Body)
...

mailserver.send(Email)

I did my best but failed, Do you guys have any idea to solve this problem?

Help me, Please

 

0 answers

Suggest an answer

Log in or Sign up to answer