If you've ever migrated data into Jira from systems like TFS (Team Foundation Server), Azure DevOps, or other platforms, you've likely encountered a frustrating problem: your carefully formatted descriptions land in Jira as raw HTML strings that look nothing like they should.
Here's a practical approach to solving this using a Rovo agent and Jira Automation—no scripting or external tools required.
When exporting data from external systems, description fields often come across as raw HTML:
<div><p>As a <strong>user</strong>, I want to...</p><ul><li>Item 1</li><li>Item 2</li></ul></div>
Instead of the nicely formatted text your users expect, they see angle brackets and HTML tags cluttering up their work items. Manually cleaning up hundreds or thousands of migrated issues isn't realistic. Sure, you could program a solution, but why bother if a quicker option is available?
The approach involves two components:
The best part? You can use Rovo itself to help you build the automation rule.
First, create an agent specifically for HTML-to-markdown conversion.
Navigate to your Rovo agents and create a new agent. The key is in the prompt—you need to be specific about which markdown format to use, because Jira's markdown behaves differently depending on context.
Here's something I discovered through trial and error: while Rovo is excellent at converting HTML to markdown out of the box, the output that works perfectly when you invoke the agent directly (from the Jira UX) doesn't always work within automation.
The issue concerns how Jira Automation's smart values (using the Mustache library) handle certain characters. Headings using # symbols, for example, can break when passed as the smart value {{agentResponse}}.
The solution is to create two scenarios in your agent:
Scenario 1: Default (for ad-hoc use from Jiras' UX)
Here is the prompt for this scenario:
---- PROMPT START ----
You are an expert assistant for transforming HTML strings into markdown that renders well in Jira long text fields. You have deep knowledge of HTML, CSS, and the markdown format supported by Jira. Your primary task is to convert the Description field (when provided as an HTML string) into Jira-compatible markdown, ensuring the output is clean, readable, and visually appealing within Jira.
These are your references for the Markdown used by Jira:
https://support.atlassian.com/jira-software-cloud/docs/markdown-and-keyboard-shortcuts/
When you transfer HTML tables, use this page as a reference: https://confluence.atlassian.com/bitbucketserverm0930/markdown-syntax-guide-1431541351.html
By default, respond only with the converted markdown string—do not add any introductory or trailing text. If the user specifically requests an explanation, provide a detailed breakdown of how the HTML was converted to Jira markdown, including the handling of formatting, lists, links, and other elements. Always respond to user requests concisely and accurately.
---- PROMPT END ----
Note that the prompt includes specific instructions on how to treat specific formats (like tables). These were added to overcome errors. So it's important to test your agent with inputs that reflect your data.
Also, the last section requests that the agent not add text before or after the converted text. Rovo tends to be too chatty this way, and these instructions help keep the response from overflowing into chatty territory.
Scenario 2: For Automation
When the agent is invoked through automation, headings need to use the old-style wiki format (h1., h2., etc.) instead of # symbols. This format is more compatible with smart values in automation.
Add a second scenario with instructions like:
---- PROMPT START ----
Because you are now running inside an automation rule, when you convert headings, please use the notation explained here: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=headings
This will avoid that your response will be broken by subsequent steps of automation.
Otherwise, follow all the instructions in your default scenario
---- PROMPT END ----
Here's where it gets interesting—you can use Rovo to help create the automation rule itself.
Give Rovo this prompt:
We need an automation rule that:
- Is triggered manually from work items
- Checks if the description field contains HTML
- If it does, invokes the agent that can translate HTML to markdown using the appropriate scenario
- Updates the description with the response from the agent
Rovo will generate most of the rule structure for you. It understands:
< and >){{agentResponse}} to capture the outputYou'll need to manually configure which agent to use, but the heavy lifting is done.
<div> or <p> or similar HTML markers)Set Description = {{agentResponse}}
Before running the automation, you have raw HTML cluttering your descriptions. After? Clean, properly formatted Jira content—headings, lists, tables, and all.
The table conversion was particularly tricky. Without specific instructions pointing the agent to Jira's table formatting documentation, tables would break. With the right references in the agent prompt, even complex tables render correctly.
Ad-hoc conversion: When you're working on a single issue and want to copy-paste the result, use the agent directly. The # heading style works perfectly here.
Bulk conversion via automation: When processing multiple issues, the automation rule with the old-style heading format (h1., h2.) ensures consistent results.
Migrating data into Jira doesn't have to mean accepting ugly HTML in your descriptions. With a Rovo agent configured with the right prompts and scenarios, plus a simple automation rule, you can clean up migrated content at scale.
Key takeaways:
h1., h2.) when working through automation
Rina Nir
CEO at RadBee
RadBee
United Kingdom
8 accepted answers
0 comments