Remove HTML tags from Jira work item descriptions after Data Center import

Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.

Summary

After migration from Jira Data Center to Jira Cloud, work item descriptions may include unrendered HTML tags like <p>, <br>, or others.

Example of HTML tags after import

<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>

Environment

  • Jira Data Center with JEditor in the process of migrating to Jira Cloud

  • Jira Cloud (recently migrated)

Remove HTML tags from JEditor before migration

If you're in the process of migration or wish to re-migrate with the issue fixed, contact JEditor support to obtain a script to remove HTML tags prior to migration.

Use Automation to clear HTML tags after migration

If the migration has already completed, we can clear the HTML tags using a Jira automation rule on the Cloud instance.

These steps must be completed by a Jira administrator, as descriptions and comments will need to be edited globally,

  1. Create a new Jira Automation rule

  2. For When: (trigger), select Scheduled

    • The schedule itself does not matter as the rule will be manually run.

  3. In the Basic tab, check the box "Run a JQL search and execute actions for each issue in the query"

  4. Add JQL:

    text ~ "<p>" AND created >= -90d

    This searches for all work items with a <p> text tag, created in the last 3 months. This assumes that any affected work items 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.

  5. Click "Validate query"

  6. Adjust the value of created until fewer than 1000 results are returned

    1. ⚠️ If more than 1000 results are returned, Jira automation thresholds will be reached.

      1. For large Jira instances, this value will be smaller

      2. For small Jira instances, this value may be larger

      3. ℹ️ The JQL may also be adjusted to target projects in batches, for example:

        project IN (OPS, DEV) AND text ~ "<p>" AND created >= -90d

  7. Select Next

  8. Select "THEN: Add an action"

  9. Search for action "Edit work item"

  10. Select the field "Description"

    1. In the large text area, add:

      {{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|&nbsp;))>","")}}

      Additional tags may be appended to remove other tags which are no longer necessary.

  11. Select "More options"

  12. Uncheck "Send notifications?"

  13. Name the rule and select Turn on rule

Manually execute the automation rule

From the rule editor for our newly created rule:

  1. In the top right corner, select "..." then "Run rule"

  2. Review the output of some affected work items - the tags should be removed

  3. Update the JQL to increase the scope, still ensuring less than 1000 work items are cleaned up in any batch

    1. For example, change the created dates for returned work items:

      text ~ "<p>" AND created < -90d AND created >= -180d

Updated on May 7, 2025

Still need help?

The Atlassian Community is here for you.