Hello,
I have written a post function which will fire an email to the designated vendor whenever the ticket reaches on Waiting for Vendor stage. The email body should contain the fields visible on the issue.
I am able fetch all the fields on to the email body. But few fields like Description and Comment have values with some formatting. We need the formatting to be the same when fetching the data on the email as well.
Is there a way that this can be achieved?
I have attached screenshots for reference.
Thanks in advance.
Regards,
Pooja
Hi Pooja!
You can get the description to show up correctly by using the email template in Plain text format instead of HTML and using $issue.description.
Hello @Carmen Creswell [Adaptavist] ,
Thank you for your response.
I had tried keeping both Text as well as Plain text format.
I was able to resolve this issue by rendering the description field.
<%def rendererManager = com.atlassian.jira.component.ComponentAccessor.getComponent(com.atlassian.jira.issue.RendererManager.class)
def fieldLayoutItem = com.atlassian.jira.component.ComponentAccessor.getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem("description")
def renderer = rendererManager.getRendererForField(fieldLayoutItem)
String desc = renderer.render(issue.description, null)%>
Doing this, helped me get the exact format of the Description field in my email notification.
Same code can be applied for getting Comments field's format.
Regards,
Pooja
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.