You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have a Jython script which sends emails. Basically, stuff like:
from com.atlassian.jira import ComponentManager from com.atlassian.jira.issue import CustomFieldManager from com.atlassian.jira.issue.fields import CustomField cfm = ComponentManager.getInstance().getCustomFieldManager() change_summary = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Change Summary")) # Build a multipart email with text and html from template, and send it ...
Now, the trick is, the Change Summary custom field is configured for wiki text rendering. If at all possible, I would want to render that into text or html for the various parts.
Shopping around the API, it looks like I want to work from here:
... using render() for HTML and renderAsText() for text? I can probably figure this out, but if anyone can point to some existing example code, I would be most grateful.
Community moderators have prevented the ability to post new answers.
Answer is actually over here: https://answers.atlassian.com/questions/135084/method-to-convert-jira-wiki-format-to-html
Here is what Jython would look like:
from com.atlassian.jira.component import ComponentAccessor from com.atlassian.event.api import EventPublisher from com.atlassian.jira.util.velocity import VelocityRequestContextFactory from com.atlassian.jira.issue.fields.renderer.wiki import AtlassianWikiRenderer eventPublisher = ComponentAccessor.getOSGiComponentInstanceOfType(EventPublisher) velocityRequestContextFactory = ComponentAccessor.getOSGiComponentInstanceOfType(VelocityRequestContextFactory) wikiRenderer = AtlassianWikiRenderer(eventPublisher, velocityRequestContextFactory) change_summary_html = wikiRenderer.render(change_summary, None) change_summary_text = wikiRenderer.renderAsText(change_summary, None)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.