Removing HTML formatting in the Jira issue descriptions from JEditor
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
After migration from Jira Server/Data Center to Jira Cloud, descriptions may be difficult to read as there are unrendered html tags. This page outlines how to remove such entities.
Environment
Jira Server/Data Center with JEditor in the process of migrating to Jira Cloud
Jira Cloud (recently migrated)
Diagnosis
After migrating, Jira issue descriptions may appear as:
<p>As a user, I want to add a widget so that I have convenient access to my wallet.</p>
<br>
<p>Users have reported that the shortcut sequence is <b>no longer</b> functional.</p>
Solution
Before migration
Contact JEditor support to obtain a script to remove html tags prior to migration.
After migration
Login to Jira as a Jira administrator. As descriptions and comments will need to be edited globally,
Create a new Jira Automation rule.
For "When:" (trigger), select "Scheduled".
The schedule itself does not matter as the rule will be manually run.
Under "JQL", check the box "Run a JQL search and execute actions for each issue in the query."
Add JQL:
1
text ~ "<p>" AND created >= -90d
This searches for all issues with a
<p>
text tag, created in the last 6 months. This assumes that any affected issues contain at least a paragraph html tag. This does not limit us from fixing other entities; it is only a starting point for the search.Click "Validate query".
Adjust the value of 180 until just under 1000 results are returned.
For large Jira instances, this value will be smaller.
For small Jira instances, this value may be larger.
⚠️ If more than 1000 results are returned, Jira automation thresholds will be reached.
ℹ️ The JQL may also be adjusted to target projects in batches, for example:
1
project IN (OPS, DEV) AND text ~ "<" AND created >= -120d
What is important is that <1000 issues are found.
Click Next.
Click "THEN: Add an action".
Search for action "Edit issue".
Select the field "Description".
In the large text area, add:
1
{{issue.description.replaceAll("</?((b|br|div|div class=.*|div style=.*|i|li|ol|p|span|span class=.*|span style=.*|strong|sub|sup|table|tbody|td|th|tr|ul| ))>","")}}
Additional tags may be appended to remove other tags which are no longer necessary.
Click "More options".
Uncheck "Send notifications?".
Click Turn on rule.
Name the rule.
Click Turn on rule.
In the top right corner, click "..." then "Run rule".
Review the output of some affected issues. The tags should be removed.
Update the JQL to increase the scope, ensuring less than 1000 issues are cleaned up in any batch.
1
text ~ "<p>" AND created < -90d AND created >= -180d
Was this helpful?