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

1 vote
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.

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 

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...

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...

0 votes
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.

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
Community showcase
Published yesterday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

202 views 0 5
Read article

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