Insert HTML after the body tag in JIRA

We are trying to put JIRA into Websphere Portal navigation and it works OK except the WP code must be placed right after the body tag on each page. We placed it following the article about placing Google Analytics code but it is inserted inside a header with some styling applied, this makes all text with a href links blue. To what file we should move the code to be rendered before the header and still on each page?

6 answers

This widget could not be displayed.
Timothy Chin Community Champion May 06, 2013

Have you tried the Annoucement Banner? If that does not work, you're gonna have to hack the decorators.

Announcement banner is rendered inside the header, the same issue.

This widget could not be displayed.

Definitely javascript (jquery) in Announcement banner is a good wroking way to do this.

Try one of these, we use both of these in our jira instance for switching styles and additional scripts:

<script type="text/javascript">

jQuery(document).ready(
    function()
    {

    jQuery('body').prepend('INSERT YOUR HTML CODE HERE');

    }

    );
</script>

or simply:

<script type="text/javascript">

jQuery('body').prepend('INSERT YOUR HTML CODE HERE');

</script>

Hi,

How to do apply This jQuery code added method for JIRA Service Desk Portal Customer View  ??

 

Thanks 

This widget could not be displayed.

Have a look into this file ...\jira\webapp\decorators\navigator.jsp. There you'll find all information you need.

\decorators\navigator.jsp file looks ok but it does not help. The home page is surely rendered with another file, I don't know which one...

This widget could not be displayed.

Announcement banner is rendered inside the header, the same issue.

\decorators\navigator.jsp file looks ok but it does not work. The home page is surely rendered with another file, I don't know which one...

This widget could not be displayed.
David Simpson Community Champion May 06, 2013

Why not just put it in the Announcement Banner, then use JavaScript to move it to the correct place in the DOM?

Paste this into the Annoucement Banner:

<div class="my-custom-banner">my custom banner</div>

<script>
  AJS.toInit(function(){
    AJS.$('body').prepend(AJS.$('.my-custom-banner'));
  });
</script>

David, your solution works, however JIRA pages obviously load without the portal navigation and after that when script is executed, the navigation bar appears. Since it is pretty large, visual experience is far from ideal.

This widget could not be displayed.

Hi,

How to do apply This jQuery code added method for JIRA Service Desk Portal Customer View  ??

 

Thanks 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

157 views 16 7
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you