• 14
    • 36
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Problem Definition

      JIRA 7 switched to precompiles jsp, that means usual .jsp template is not read by Tomcat any more.
      Previously in JIRA 6, users are able to modify the default .jsp template file where customisation is possible by following this documentation JIRA Template & JSP's. However, at this moment, there is no documentation on how this can be achieved for JIRA 7.

      Suggested Solution

      To have documentation as per JIRA Template & JSP's for JIRA 7 and steps on how to make the changes done on the JSP files to be accepted by JIRA 7

      Note

      <atlassian-jira>/atlassian-jira/includes/decorators/aui-layout/header.jsp page is not injected into every page in JIRA. So documentation should include new instructions, if possible.

          Form Name

            [JRASERVER-59587] Request for documentation on how to tweak JSP in JIRA 7

            Chris Kent added a comment - - edited

            I have just upgraded to Jira 9.9.1 and this hack no longer works....

            I have commented out all references to head-resources.jsp, however the new menu item only shows up in admin mode, not in the general pages.

            Atlassian has added a new reference in a jsp file called './decorators/general-flush-early-head-and-header-skeleton.jsp'

            The name of this is suspicious and maybe this hack no longer works...

            Has anyone had any luck with latest versions of JIRA?

            Why do we still have to do this painful hack Atlassian??????????????

            IGNORE this, I found the issue... AJS.toInit() is not valid on page load in general pages, once I removed this it all worked.

            I see a few plugins use this and are throwing errors too - OMG...


            Chris Kent added a comment - - edited I have just upgraded to Jira 9.9.1 and this hack no longer works.... I have commented out all references to head-resources.jsp, however the new menu item only shows up in admin mode, not in the general pages. Atlassian has added a new reference in a jsp file called './decorators/general-flush-early-head-and-header-skeleton.jsp' The name of this is suspicious and maybe this hack no longer works... Has anyone had any luck with latest versions of JIRA? Why do we still have to do this painful hack Atlassian?????????????? — IGNORE this, I found the issue... AJS.toInit() is not valid on page load in general pages, once I removed this it all worked. I see a few plugins use this and are throwing errors too - OMG...

            Matt Doar added a comment -

            I get that problem with setting the Announcement banner in chrome too. It's being tracked at https://jira.atlassian.com/browse/JRASERVER-67049

            Matt Doar added a comment - I get that problem with setting the Announcement banner in chrome too. It's being tracked at https://jira.atlassian.com/browse/JRASERVER-67049

            Currently, I am trying to add the Javascript for Matomo within the announcement banner for our dev instance of Jira. I am continuously getting an error when trying to "set banner". This is for Jira Data Center v7.13.1.

             

            Error received is "This page isn’t working Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards).
            Try visiting the site's homepage.
            ERR_BLOCKED_BY_XSS_AUDITOR"

             

            Is this due to the other issues raised above?

            Tyler Anderson added a comment - Currently, I am trying to add the Javascript for Matomo within the announcement banner for our dev instance of Jira. I am continuously getting an error when trying to "set banner". This is for Jira Data Center v7.13.1.   Error received is "This page isn’t working Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards). Try visiting the site's homepage. ERR_BLOCKED_BY_XSS_AUDITOR"   Is this due to the other issues raised above?

            Erica added a comment -

            Christian, you can add the Piwik in the "announcement banner" field. I've seen it in there before and seems to work.

            Erica added a comment - Christian, you can add the Piwik in the "announcement banner" field. I've seen it in there before and seems to work.

            No progress in this topic?

            So how to add custom HTML/Javascript for Piwik? or any other analytics tools.
            And just to add: When will we get https://content-security-policy.com/ working without compromises

            Christian Bretterhofer added a comment - No progress in this topic? So how to add custom HTML/Javascript for Piwik? or any other analytics tools. And just to add: When will we get https://content-security-policy.com/ working without compromises

            Ahmad Awadallah added a comment - - edited

            Following what @Sergey Temchenko stated we got this to work by doing the following:

            • Removed our javascript code from header.jsp and placed it in head-resources.jsp.
            • Removed reference of head-resources.jsp from web.xml.
            • Search all files in JIRA_HOME for any files that references head-resources.jsp by running: grep -r "aui-layout/head-resources\.jsp" atlassian-jira/
            • Noted all .jsp files that referenced 'head-resources.jsp' and removed the references of those .jsp files from web.xml.
            • Restarted Jira and we were all set.

            Below are the .jsp files that was found from the search I ran to find all references to 'head-resources.jsp'. We then removed references of these files from web.xml:

            $ grep -r "aui-layout/head-resources\.jsp" atlassian-jira/
            
            atlassian-jira/displayError.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/navigator.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/admin.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/general.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/popups.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/printable.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/onboarding.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/message.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/issueaction.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/general-head-pre.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/blank.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/error.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/userprofile.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/panel-admin.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/panel-general.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/content-panel-only.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            atlassian-jira/decorators/login.jsp:    <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %>
            

            Hope this helps.

            Ahmad Awadallah added a comment - - edited Following what @Sergey Temchenko stated we got this to work by doing the following: Removed our javascript code from header.jsp and placed it in head-resources.jsp. Removed reference of head-resources.jsp from web.xml. Search all files in JIRA_HOME for any files that references head-resources.jsp by running: grep -r "aui-layout/head-resources\.jsp" atlassian-jira/ Noted all .jsp files that referenced 'head-resources.jsp' and removed the references of those .jsp files from web.xml. Restarted Jira and we were all set. Below are the .jsp files that was found from the search I ran to find all references to 'head-resources.jsp'. We then removed references of these files from web.xml: $ grep -r "aui-layout/head-resources\.jsp" atlassian-jira/ atlassian-jira/displayError.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/navigator.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/admin.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/general.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/popups.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/printable.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/onboarding.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/message.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/issueaction.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/general-head-pre.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/blank.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/error.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/userprofile.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/panel-admin.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/panel-general.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/content-panel-only.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> atlassian-jira/decorators/login.jsp: <%@ include file="/includes/decorators/aui-layout/head-resources.jsp" %> Hope this helps.

            @James Hunt [Agency Consulting Group], i had same problem, but after few attempts i got result. If you want customize header, you shouldn't edit header.jsp, instead you should edit head-resources.jsp and remove it from web.xml. Why head-resources.jsp? I don't know) After i had edited every head file, i realized, that on different pages(auth\non auth), different head file is included and only head-resources.jsp is includede everywhere. So i removed head-resources.jsp from web.xml, added my own <meta> tags, restarted jira and got result.

            Sergey Temchenko added a comment - @James Hunt [Agency Consulting Group] , i had same problem, but after few attempts i got result. If you want customize header, you shouldn't edit header.jsp, instead you should edit head-resources.jsp and remove it from web.xml. Why head-resources.jsp? I don't know) After i had edited every head file, i realized, that on different pages(auth\non auth), different head file is included and only head-resources.jsp is includede everywhere. So i removed head-resources.jsp from web.xml, added my own <meta> tags, restarted jira and got result.

            jhunt, at least on JIRA 7.1, it looks like there another dozen or so dependencies of header.jsp that will also need to have their references commented out in web.xml:

            $ grep -r "aui-layout/header\.jsp" atlassian-jira/
            
            atlassian-jira//WEB-INF/web.xml:        <url-pattern>/includes/decorators/aui-layout/header.jsp</url-pattern>
            atlassian-jira//decorators/admin.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/error.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/general.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/issueaction.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/login.jsp:                <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/message.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/navigator.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/onboarding.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/panel-admin.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/panel-general.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            atlassian-jira//decorators/userprofile.jsp:        <%@ include file="/includes/decorators/aui-layout/header.jsp" %>
            

            Scott Dudley [Inactive] added a comment - jhunt , at least on JIRA 7.1, it looks like there another dozen or so dependencies of header.jsp that will also need to have their references commented out in web.xml: $ grep -r "aui-layout/header\.jsp" atlassian-jira/ atlassian-jira //WEB-INF/web.xml: <url-pattern>/includes/decorators/aui-layout/header.jsp</url-pattern> atlassian-jira //decorators/admin.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/error.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/general.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/issueaction.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/login.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/message.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/navigator.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/onboarding.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/panel-admin.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/panel-general.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %> atlassian-jira //decorators/userprofile.jsp: <%@ include file= "/includes/decorators/aui-layout/header.jsp" %>

            I have used the methods prescribed repeatedly and it isn't working on our system. We are modifying the header.jsp and I am not finding any other references to it other than the web.xml.

            James E. Hunt [ASRC Federal] added a comment - I have used the methods prescribed repeatedly and it isn't working on our system. We are modifying the header.jsp and I am not finding any other references to it other than the web.xml.

            @alexandru.luchian88, @sdudley hello! Is it still working? I've modified login.jsp like in example above, restart jira and got nothing. Also, i've removed all servlet, servlet-mapping from web.xml within <!--Added by Tomcat --> section, and still nothing. Tomcat has correct(modified) files inside, but in browser i get default page. Any ideas?

            Sergey Temchenko added a comment - @alexandru.luchian88, @sdudley hello! Is it still working? I've modified login.jsp like in example above, restart jira and got nothing. Also, i've removed all servlet, servlet-mapping from web.xml within <!--Added by Tomcat --> section, and still nothing. Tomcat has correct(modified) files inside, but in browser i get default page. Any ideas?

              Unassigned Unassigned
              amasut Azfar Masut (Inactive)
              Votes:
              141 Vote for this issue
              Watchers:
              96 Start watching this issue

                Created:
                Updated: