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.

            [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

            a7e9ce396f68 Thanks for the feedback! I fully agree! However, the CSS snippet footprint is negligible, so I'm hoping this info will be useful to any admins watching this report that are still looking for a workaround!

            Pietro Lemes added a comment - a7e9ce396f68 Thanks for the feedback! I fully agree! However, the CSS snippet footprint is negligible, so I'm hoping this info will be useful to any admins watching this report that are still looking for a workaround!

            Hi Pietro Lems, thank you for the documentation for a possible workaround. But running through this CSS every time a Jira screen is opened only to mitigate a a Atlassian Bug seems not acceptable for us. Because on very few screens have the problem with the mentioned field descriptions and we do not want to use the big hammer to mitigate the problem. Atlassian should work on a specific solution of their bug!

            Michael Mohr added a comment - Hi Pietro Lems, thank you for the documentation for a possible workaround. But running through this CSS every time a Jira screen is opened only to mitigate a a Atlassian Bug seems not acceptable for us. Because on very few screens have the problem with the mentioned field descriptions and we do not want to use the big hammer to mitigate the problem. Atlassian should work on a specific solution of their bug!

            Appreciate your workaround thoughts @Matt and it works well 

            anja.sandadi added a comment - Appreciate your workaround thoughts @Matt and it works well 

            Matt Doar added a comment -

            Stijn Adams did the heavy lifting

            Matt Doar added a comment - Stijn Adams did the heavy lifting

            Thank you very much @Matt! That is a great workaround

            Dakota Bramblette added a comment - Thank you very much @Matt! That is a great workaround

            Matt Doar added a comment -

            If you have ScriptRunner, the Behaviour approach above works well for us

            Matt Doar added a comment - If you have ScriptRunner, the Behaviour approach above works well for us

            Monty added a comment -

            We just upgraded to 8.22.6 and the issue is still present.

            Monty added a comment - We just upgraded to 8.22.6 and the issue is still present.

            Jackie Leonard added a comment - - edited

            We are affected by this issue.  Please resolve.

            Jackie Leonard added a comment - - edited We are affected by this issue.  Please resolve.

            Matt Doar added a comment - - edited

            I went with the Behaviour approach but added a test in the code because I wasn't sure what happened if the field was not present in a screen

            def targetStart = getFieldByName('Target start')
            if (targetStart != null) {
              targetStart.setDescription("The targeted start date. Use the d/MMM/yy date format.")
            }
            

            Perhaps this is not necessary because if "Target start" is not on a screen then the Behaviour won't be invoked on it. I'm not sure

            Matt Doar added a comment - - edited I went with the Behaviour approach but added a test in the code because I wasn't sure what happened if the field was not present in a screen def targetStart = getFieldByName('Target start') if (targetStart != null) { targetStart.setDescription("The targeted start date. Use the d/MMM/yy date format.") } Perhaps this is not necessary because if "Target start" is not on a screen then the Behaviour won't be invoked on it. I'm not sure

            Matt Doar added a comment -

            No-one has pointed out that the fields' descriptions refers to the old name for the product: "Portfolio"

            Matt Doar added a comment - No-one has pointed out that the fields' descriptions refers to the old name for the product: "Portfolio"

            Kevin - Would suggest 8.20.11 instead... Been released last week - has some bugfixes, including for JRASERVER-63285 - JIRA does not create issue by email with the default reporter, if the sender is associated to an user who is inactive or does not have a license

            Rafe Nussey added a comment - Kevin - Would suggest 8.20.11 instead... Been released last week - has some bugfixes, including for JRASERVER-63285 - JIRA does not create issue by email with the default reporter, if the sender is associated to an user who is inactive or does not have a license

            We are in the process of upgrading to 8.20.10 DC and encountered this issue.  Are there plans to correct the tags on a minor or in a workaround other than scriptrunner?  We have added a single behavior for all projects and all issuetypes until there is a resolution.  

            Kevin Dalton added a comment - We are in the process of upgrading to 8.20.10 DC and encountered this issue.  Are there plans to correct the tags on a minor or in a workaround other than scriptrunner?  We have added a single behavior for all projects and all issuetypes until there is a resolution.  

            in Our Jira instance (LTS 8.20.9) we are also effected by this error, even that we have allowed HTML text in field descriptions. The workarounds are not possible/allowed at our company. So we need a solution for this error as it confuses our end-users

            Michael Mohr added a comment - in Our Jira instance (LTS 8.20.9) we are also effected by this error, even that we have allowed HTML text in field descriptions. The workarounds are not possible/allowed at our company. So we need a solution for this error as it confuses our end-users

            Applies to 8.20.10 also

            Tapio Heiskanen added a comment - Applies to 8.20.10 also

            We are on 8.20.9 and are affected by this Bug.

            Kirankumar Talapaneni added a comment - We are on 8.20.9 and are affected by this Bug.

            Stijn Adams added a comment - - edited

            Context overview

            As this moment (22 Jun 2022), there is no solution available.
            However, two workarounds are published and voted by individuals:

            • Code-injection (CSS) through Announcement Banner
            • Code-injection (Groovy) through Scriptrunner

            Within the step-by-step guide below, we've built further on the suggestion of Therese Hedberg.

            Step-by-step guide

            In this step-by-step guide below, we'll perform the necessary configuration to enable the functionality.

            1.  Perform the necessary configuration to enable the functionality with ScriptRunner 
              1. Within the horizontal menu you're able to locate a 'configuration icon'. Click it, which provides you to click on 'Manage Apps'.
              2. Within the vertical menu you're able to locate 'Behaviours'. Click 'Behaviours'.
              3. On the right-side of the opened page you're able to locate 'Create Behaviour'. Click 'Create Behaviour'.
              4. In the text field field of the section 'Create Behaviour' you're able to fill in a value. Fill in as described below:
                1. Name: 'TOOLTRIBE-17057'
                2. Description: '(ATL) update description of the target end and target start dates'
              5. In the middle of the opened page you're able to locate 'Create Mapping'. Click 'Create Mapping'.
              6. In the text field field of the section 'Mappings' you're able to fill in a value. Fill in as described below:
                1. Choose mapping type: select 'Use project/issuetype mapping'
                2. Choose project: 'All projects'
                3. Choose issue types: 'All issue types'
              7. At the end of the opened page you're able to locate 'Add Mapping'. Click 'Add Mapping'.
              8. At the end of the opened page you're able to locate 'Create'. Click 'Create'.
              9. In the text field field of the section 'Behaviour settings' you're able to fill in a value. Fill in as described below:
                1. Add field: 'Target start'
              10. At the end of the opened page you're able to locate 'Add'. Click 'Add'.
              11. In the text field field of the section 'Behaviour settings' you're able to fill in a value. Fill in as described below:
                1. Add field: 'Target end'
              12. At the end of the opened page you're able to locate 'Add'. Click 'Add'.
              13. In the text field field of the section 'Fields' you're able to fill in a value. Fill in as described below:
                1. Target start - Script: (see script mentioned within this Page)
                2. Target end - Script: (see script mentioned within this Page)

            Attachment

            Target start:

            /**
            Source: [DELETED]
            Author(s): ADAMS Stijn (stijn.adams@calmware.be)
            Last update: 2022-06-22
            Version: v1.0
            **/ 
            
            def targetStart = getFieldByName('Target start')
            targetStart.setDescription("The targeted start date. Use the d/MMM/yy date format.") 

            Target end:

            /**
            Source: [DELETED]
            Author(s): ADAMS Stijn (stijn.adams@calmware.be)
            Last update: 2022-06-22
            Version: v1.0
            **/ 
            
            def targetEnd = getFieldByName('Target end')
            targetEnd.setDescription("The targeted end date. Use the d/MMM/yy date format.")

             

             

            Stijn Adams added a comment - - edited Context overview As this moment (22 Jun 2022), there is no solution available. However, two workarounds are published and voted by individuals: Code-injection (CSS) through Announcement Banner Code-injection (Groovy) through Scriptrunner Within the step-by-step guide below, we've built further on the suggestion of Therese Hedberg. Step-by-step guide In this step-by-step guide below, we'll perform the necessary configuration to enable the functionality.   Perform the necessary configuration to enable the functionality with ScriptRunner   Within the horizontal menu you're able to locate a 'configuration icon'. Click it, which provides you to click on 'Manage Apps'. Within the vertical menu you're able to locate 'Behaviours'. Click 'Behaviours'. On the right-side of the opened page you're able to locate 'Create Behaviour'. Click 'Create Behaviour'. In the text field field of the section 'Create Behaviour' you're able to fill in a value. Fill in as described below: Name: 'TOOLTRIBE-17057' Description: '(ATL) update description of the target end and target start dates' In the middle of the opened page you're able to locate 'Create Mapping'. Click 'Create Mapping'. In the text field field of the section 'Mappings' you're able to fill in a value. Fill in as described below: Choose mapping type: select 'Use project/issuetype mapping' Choose project: 'All projects' Choose issue types: 'All issue types' At the end of the opened page you're able to locate 'Add Mapping'. Click 'Add Mapping'. At the end of the opened page you're able to locate 'Create'. Click 'Create'. In the text field field of the section 'Behaviour settings' you're able to fill in a value. Fill in as described below: Add field: 'Target start' At the end of the opened page you're able to locate 'Add'. Click 'Add'. In the text field field of the section 'Behaviour settings' you're able to fill in a value. Fill in as described below: Add field: 'Target end' At the end of the opened page you're able to locate 'Add'. Click 'Add'. In the text field field of the section 'Fields' you're able to fill in a value. Fill in as described below: Target start - Script: (see script mentioned within this Page) Target end - Script: (see script mentioned within this Page) Attachment Target start: /** Source: [DELETED] Author(s): ADAMS Stijn (stijn.adams@calmware.be) Last update: 2022-06-22 Version: v1.0 **/  def targetStart = getFieldByName( 'Target start' ) targetStart.setDescription( "The targeted start date. Use the d/MMM/yy date format." ) Target end: /** Source: [DELETED] Author(s): ADAMS Stijn (stijn.adams@calmware.be) Last update: 2022-06-22 Version: v1.0 **/  def targetEnd = getFieldByName( 'Target end' ) targetEnd.setDescription( "The targeted end date. Use the d/MMM/yy date format." )    

            GN added a comment -

            Jira 8.22.2 also affected

            GN added a comment - Jira 8.22.2 also affected

            Matt Doar added a comment - - edited

            You could also try unlocking the field and changing the description text. However it may already have been copied into field configurations as well.

            Update: I tried this but the HTML is not present in the two field's descriptions. Must be added somewhere else

            Matt Doar added a comment - - edited You could also try unlocking the field and changing the description text. However it may already have been copied into field configurations as well. Update: I tried this but the HTML is not present in the two field's descriptions. Must be added somewhere else

            Agree with the two latest version 8.20.8 is affected

            The workaround from Pietro Lemes does help

            Peter Adrial added a comment - Agree with the two latest version 8.20.8 is affected The workaround from Pietro Lemes does help

            Alex Nie added a comment -

            Jira 8.20.8 also affected

            Alex Nie added a comment - Jira 8.20.8 also affected

            Jira 8.20.8 also affected

            Krzysztof Skrzypczyk added a comment - Jira 8.20.8 also affected

            Possible workaround:

            I was able to come up with a simple workaround, please, test it on your Jira.

            Add this piece of CSS after the last line of your 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 CSS snippet will hide the description for the custom fields on the Edit screen.

            Kind regards,

            Pietro Lemes
            Atlassian Support

            Pietro Lemes added a comment - Possible workaround: I was able to come up with a simple workaround, please, test it on your Jira. Add this piece of CSS after the last line of your 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 CSS snippet will hide the description for the custom fields on the Edit screen. Kind regards, Pietro Lemes Atlassian Support

            Advanced Roadmaps might need to add 

            #disable_html_escaping()

            to their velocity template.

            Darin Hafer added a comment - Advanced Roadmaps might need to add  #disable_html_escaping() to their velocity template.

            Therese Hedberg added a comment - - edited

            Hi Joseph.

            We put it in the Initialiser, with mappings to all projects and all issue types. (We have Jira Data Center)

            Therese Hedberg added a comment - - edited Hi Joseph. We put it in the Initialiser, with mappings to all projects and all issue types. (We have Jira Data Center)

            Hi Therese:

            Please advise which part of Scriptrunner Behaviour component that you implemented the code?  Example setup Behavior serverside scripts or Initializer against those two fields?

            Best, Joseph Chung Yin

            Joseph Chung Yin added a comment - Hi Therese: Please advise which part of Scriptrunner Behaviour component that you implemented the code?  Example setup Behavior serverside scripts or Initializer against those two fields? Best, Joseph Chung Yin

            Therese Hedberg added a comment - - edited

            We managed to fix this by using an external app (scriptrunner) and putting this code inside a behaviour:

            def targetStart = getFieldById("customfield_12701")
            def targetEnd = getFieldById("customfield_12702")
            targetStart.setDescription("") 
            targetEnd.setDescription("") 

            Therese Hedberg added a comment - - edited We managed to fix this by using an external app (scriptrunner) and putting this code inside a behaviour: def targetStart = getFieldById( "customfield_12701" ) def targetEnd = getFieldById( "customfield_12702" ) targetStart.setDescription("") targetEnd.setDescription("")

            Please sort this out. It sounds trivial but it's a frustration to our users.

            Gary Bates added a comment - Please sort this out. It sounds trivial but it's a frustration to our users.

            We just upgraded our Jira DC/JSM DC from 8.17.1/4/17.1 to 8.20.4/4.20.4 - and also have the same issue now.  Please address ASAP.

            Best, Joseph

            Joseph Chung Yin added a comment - We just upgraded our Jira DC/JSM DC from 8.17.1/4/17.1 to 8.20.4/4.20.4 - and also have the same issue now.  Please address ASAP. Best, Joseph

            Monty added a comment -

            8.19.1 also affected. It's an Advanced Roadmaps custom field issue.
            This was an issue in the past with "<p></p>" tags on those same fields as well, but enabling the Admin>System>Enable HTML in field descriptions and list item values option to "On" would fix it for the "<p>" tags. However it does not fix it for these "<span>" tags this time around.

            Monty added a comment - 8.19.1 also affected. It's an Advanced Roadmaps custom field issue. This was an issue in the past with "<p></p>" tags on those same fields as well, but enabling the Admin>System>Enable HTML in field descriptions and list item values option to " On " would fix it for the "<p>" tags. However it does not fix it for these "<span>" tags this time around.

            This bug also appeared on customers instance. Please fix it.

            Jerome Brandt added a comment - This bug also appeared on customers instance. Please fix it.

            Please fix this, it looks bad and makes the form harder to read.

            Therese Hedberg added a comment - Please fix this, it looks bad and makes the form harder to read.

            Alex Nie added a comment -

            This issue also affects my team in Jira 8.20.2, please fix ASAP

            Alex Nie added a comment - This issue also affects my team in Jira 8.20.2, please fix ASAP

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

                Created:
                Updated:
                Resolved: