Ability to migrate Text gadget content to Rich Text gadget in bulk using script/automation

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Dashboard & Gadgets
    • None
    • 36
    • 8

      Issue Summary

      The Text gadget was deprecated in Jira Data Center version 9.11 and fully removed in version 11.0.x to eliminate the potential security risk posed by a possible arbitrary HTML that the Text gadget might contain.
      Once the user migrate to version 11.0.x, the Dashboards configured with Text gadgets starts showing rendering error.
      Currently, there is no available method to perform a bulk migration of content from the Text gadget to the Rich Text gadget. 

      Jira Software 9.11.x release notes
      Jira Software 11.0.x release notes

      Expected Results
      It would be really helpful & time saving if there were an automation, script, or feature that could assist in converting Text gadget content to Rich Text gadget in bulk since it is time consuming to modify the gadgets and copying the content.

      Actual Results
      We need to manually go to each gadget, copy the content from Text gadget to Rich Text gadget.

      Workaround

      • (!)Take a database backup first, as we’re about to perform changes. If you have a staging environment, do it there first to validate.
      • Take note of the dashboards/gadgets we’re about to update:
         
        SELECT pp.PAGENAME AS dashboard_name,
        	   pp.ID AS dashboard_id,
               au.lower_user_name AS dashboard_owner,
               pc.ID AS gadget_id,
               LEFT(gup.USERPREFVALUE, 200) AS content_preview
        FROM portletconfiguration pc
        JOIN portalpage pp ON pc.PORTALPAGE = pp.ID
        LEFT JOIN gadgetuserpreference gup ON pc.ID = gup.PORTLETCONFIGURATION
        JOIN app_user au on au.user_key=pp.USERNAME
        WHERE pc.GADGET_XML LIKE '%com.atlassian.jira.gadgets:text-gadget%'
        ORDER BY pp.PAGENAME, pc.ID;
        
      • Run this query to update the gadgets:
         
        UPDATE portletconfiguration
        SET gadget_xml = 'rest/gadgets/1.0/g/com.atlassian.jira.gadgets:rte-text-gadget/gadgets/rte-text-gadget.xml'
        WHERE gadget_xml = 'rest/gadgets/1.0/g/com.atlassian.jira.gadgets:text-gadget/gadgets/text-gadget.xml'
        
      • Restart Jira (if you have a multi-node setup, you can restart one node at a time)
      • Verify that the text gadgets now show up as rich text gadgets
        Notice that rich text gadgets don’t render HTML, so some users might have to update their dashboards.

              Assignee:
              Unassigned
              Reporter:
              Hemant .
              Votes:
              8 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: