It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 

did you get any solution for your query 

 

regards

Vishal Goel

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Expose your beautifully crafted Dashboard through the Jira Service Desk Customer Portal

  A picture is worth a thousand words, especially when you're trying to find relationships and understand your data. Here, Dashboards play a vital role in gaining insights from a variety of dat...

365 views 5 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you