We have an instance running JIRA Server v7.1.8 with JIRA Service Desk 3.1.9.
I can do this easily enough in JIRA core by using the announcement banner but it seems that the Customer portal banner will not allow it and simply renders the script tag as plain text.
There is no public API to allow you to do that. The closest you can do is to create a P2 plugin with web-resource module, and set the context to <context>customerportal</context>.
But again this is not a supported public API, and only available in server.
Read more about P2 web-resource plugin module here: https://developer.atlassian.com/jiradev/jira-platform/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/web-resource-plugin-module
Fair enough. Do you know what source file in JIRA handles saving the content for the Service Desk announcement banners?
To be honest with you, I would rather modify the save method to not convert the html to html entities so that the tags placed in the banner are actually rendered as html on the portal, essentially duplicating the functionality of the JIRA Core announcement banner.
We need our admin to have the ability to change the content when needed. The announcement banner is a perfect solution (aside from this self inflicted handicap).
It doesn't really make sense to us why Atlassian chose to block this feature on the customer side.
Hi Steven, thanks for your time. I have to say that I disagree. The JIRA Core announcement banner renders whatever you put in it exactly as you enter it, nothing special there. When Atlassian designed the Service Desk announcement banner, they made the very intentional decision to to strip out the html tags by calling a method on the input such as StringEscapeUtils.escapeHtml() thereby blocking the administrator's ability to add html tags to the banner. Atlassian states here their reasoning for that (basically that this was done on purpose because Project Admins can edit the SD Banner and Atlassian considers Project Admins to be less trusted than global admins.).
While I get that, to a degree, all that would be needed to avoid this, is a checkbox on the Global admin side like "Allow HTML in SD Announcement Banner: Yes / No". This way, the Global Admin can decide if they trust their Project Admins (we do).
While a plugin type solution would work, I would prefer to find where Atlassian calls StringEscapeUtils.escapeHtml() (or similar) on the banner input before saving it to the database and simply remove that line. It really shouldn't be any more complicated than that. This would make the banners function the same way on Service Desk as they do on JIRA Core.
Don't get me wrong, I didn't ask this just to complain. I was honestly hoping that we had just missed the setting to enable HTML somewhere.
I think you have this backwards. Atlassian isn't 'blocking' the announcement banner from working. They haven't built in a way to render the HTML tags from the banner. It's likely all escaped and non-functional from the get-go, so a quick 'hack' to prevent or stop that doesn't exist.
This is something that is either considered from the get-go (like core JIRA) or that they build an API for – Neither of those occurred here. Again, they haven't 'blocked' you like you state – They never built that feature like you desire.
I can poke around to find the template used for the portal, but it wouldn't be easy or quick.
The best way would be to take Gerry's method. You could expose an admin screen so someone could add HTML as necessary as well. It is approached as a plugin though.
Just the FAQs! Welcome to the Community, and this Focused-FAQ! Here, we've pulled together some of the most frequently asked questions associated with Jira Service Desk (JSD). We hope ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs