Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-21961

Target start/Target end Date - Html tags visible in field description during issue edit/create screen

      Issue Summary

      Custom field description for "Target start/Target end" in Jira shows the description of these fields is coming within HTML tags on the issue Edit/Create Screen.

      Steps to Reproduce

      • Edit an issue having Target start and Target end date on Edit/Create issue screen
      • Description of Target start and Target end comes under the HTML tags:

      Workaround

      Adding CSS on the Announcement Banner:

      <style type="text/css">
      #customfield_XXXXX-description {display: none;}
      #customfield_YYYYY-description {display: none;}
      </style>
      

      Change the "XXXXX" and "YYYYY" with the IDs for the "Target Start" and "Target End" custom field IDs.

      This will hide the description for the custom fields on the Edit screen.

          Form Name

            [JSWSERVER-21961] Target start/Target end Date - Html tags visible in field description during issue edit/create screen

            Still happens in LTS 9.4.7

            Michael Mohr added a comment - Still happens in LTS 9.4.7

            Seems to be fixed in Jira 9.9.1

            Maxime Boyer added a comment - Seems to be fixed in Jira 9.9.1

            Maxime Boyer added a comment - - edited

            @Ari, if you don't use the banner to display text, you can hide it by adding the following to it:

            <style type="text/css">
                div#announcement-banner {display:none !important;}
            </style>

            From my testing, you can only have 1 style block in the banner. If you already have one, add the style there instead.

            Maxime Boyer added a comment - - edited @Ari, if you don't use the banner to display text, you can hide it by adding the following to it: <style type= "text/css" >    div#announcement-banner {display:none !important;} </style> From my testing, you can only have 1 style block in the banner. If you already have one, add the style there instead.

            Same issue here with Jira Software 9.4.3, and workarounds provided work, but not that nice to have small empty banner visible for users

            Ari Kostamovaara added a comment - Same issue here with Jira Software 9.4.3, and workarounds provided work, but not that nice to have small empty banner visible for users

            Harsh added a comment -

            Another workaround for the team who don't want to make changes within Announcement banner.

            Via Scriptrunner, we can create a separate behavior and set the field description by writing code snippet under initializer.

            getFieldByName('Target end').setDescription('Use the d/MMM/yy date format')
            getFieldByName('Target start').setDescription('Use the d/MMM/yy date format')

            Harsh added a comment - Another workaround for the team who don't want to make changes within Announcement banner. Via Scriptrunner, we can create a separate behavior and set the field description by writing code snippet under initializer. getFieldByName( 'Target end' ).setDescription( 'Use the d/MMM/yy date format' ) getFieldByName( 'Target start' ).setDescription( 'Use the d/MMM/yy date format' )

            Maxime Boyer added a comment - - edited

            Another workaround in JavaScript:

            <!-- Removes unrendered HTML tags from field descriptions -->
            <script type="module">
                AJS.toInit(function() {
                    for (let description of AJS.$("div.field-group > div.description")) {
                        description.innerText = description.innerText.replace(/<[^>]*>?/gm, '');
                    }
                });
            </script>

            This workaround doesn't require hardcoding the custom field names. It will loop through every description and filter using a regular expression.

            In Jira 9, scripts must be of type 'module' if using global variables like AJS to get loaded asynchronously in the defer phase. Details here

            Maxime Boyer added a comment - - edited Another workaround in JavaScript: <!-- Removes unrendered HTML tags from field descriptions --> <script type= "module" >     AJS.toInit( function () {         for (let description of AJS.$( "div.field-group > div.description" )) {             description.innerText = description.innerText.replace(/<[^>]*>?/gm, '');         }     }); </script> This workaround doesn't require hardcoding the custom field names. It will loop through every description and filter using a regular expression. In Jira 9, scripts must be of type 'module' if using global variables like AJS to get loaded asynchronously in the defer phase. Details here

            Gisela Lassahn added a comment - - edited

            I've just found out that you can exchange the displayed text via CSS used in the Announcement banner:

            <style type="text/css">
            #customfield_XXXXX-description {text-indent: -9999px;line-height: 0;}
            #customfield_XXXXX-description:after {content:'Targeted start date, required for Plans';text-indent: 0;display: block;line-height: initial;}
            #customfield_YYYYY-description {text-indent: -9999px;line-height: 0;}
            #customfield_YYYYY-description:after {content:'Targeted end date, required for Plans';text-indent: 0;display: block;line-height: initial;}
            </style>
            
            

            Replace XXXXX and YYYYY by your customfield numbers and the content by the text you want to see.

            Use it on your own risk!

            Gisela Lassahn added a comment - - edited I've just found out that you can exchange the displayed text via CSS used in the Announcement banner: <style type="text/css"> #customfield_XXXXX-description {text-indent: -9999px;line-height: 0;} #customfield_XXXXX-description:after {content:'Targeted start date, required for Plans';text-indent: 0;display: block;line-height: initial;} #customfield_YYYYY-description {text-indent: -9999px;line-height: 0;} #customfield_YYYYY-description:after {content:'Targeted end date, required for Plans';text-indent: 0;display: block;line-height: initial;} </style> Replace XXXXX and YYYYY by your customfield numbers and the content by the text you want to see. Use it on your own risk!

            Affects Jira DC 8.20.4 as well; workaround helps

            Gisela Lassahn added a comment - Affects Jira DC 8.20.4 as well; workaround helps

            Workaround works well on 8.20.10

            Mayank Kamra added a comment - Workaround works well on 8.20.10

            Jira 8.20.10 is affected as well

            Juan Ramón Alonso García added a comment - Jira 8.20.10 is affected as well

              Unassigned Unassigned
              fe9534534cb0 Deepak Kumar
              Affected customers:
              169 This affects my team
              Watchers:
              147 Start watching this issue

                Created:
                Updated:
                Resolved: