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

JavaScript or Redirect in Customer Portal


We are running JIRA Server and are wondering if there is a way to implement any sort of JavaScript or redirect in the customer portal through customization? We would like to have a few categories with the customer portal that would link to an internal service page. For example, we would like to have a "Request Hardware" request type in the customer portal and have that redirect to an internal web page instead of transitioning to the next ticket creation screen.



2 answers

2 votes
Mina Samy Atlassian Team Sep 25, 2016

Hi Josh

Official support for this is coming with JIRA Service Desk 3.2.2, so keep an eye out for that.

Once you are on that version you can use the "servicedesk.portal" context to include your JS resources on the customer portal.

Until then though, you can use the "customerportal" context. Note however that this context is NOT public API and is subject to change without notice. So please make sure to migrate to the new context when you upgrade to 3.2.2.

Hi Mina!

Sorry for all the questions but i am still a beginner in this! Where exactly would the "customerportal" context be included at?


Mina Samy Atlassian Team Sep 25, 2016

It is probably a good idea to have a read of this guide:

Thank you! I will give this a try!

Hi Mina,

I looked at the link you provided and I am wondering where I should put these files. I created an xml file called "atlassian-plugin.xml" and a "portal.js". They both live in the JIRA conf folder with the context.xml. Is this the correct location? I also am unsure if my file is written with 100% correct syntax. Could you provide some feedback?



<web-resource name="Resources" key="resources">
        <resource name="portal.js" type="download" location="portal.js">



$(document).ready(function() {
            if(window.location == "") {window.location.href = "https://redirecturlcom"}
            if(window.location == "") {window.location.href = ""}
Mina Samy Atlassian Team Sep 28, 2016

Your syntax looks fine. You will see errors in the JS console or in the logs if the file could not be found so look out for that. Otherwise, this should work.

Hi Mina and All,

First, Mina is right about using "servicedesk.portal" in version 3.2 or later.  I am actually on version 3.3.  "customerportal" was working for me in v.3.1 but not in 3.3, Thank you Mina.

Second, when I use "servicedesk.portal" with my web resource plugin, it did not seem to work at first.  That is because my CSS file did not do anything to the customer portal.  Upon closer examination, my CSS file is being referenced inside the long string after href on line  <llink type="text/css" ...> (which you can see when you view source on your customer portal).

&lt;link type="text/css" rel="stylesheet" href="/s/a7387e755408613702b3f3cac7d758b0-CDN/8m41i3/73011/9024b0dd00a69c0253ae96d6c4be3e3a/932c0d13fddb474b73c48c5dc1a2fa31/a613160711a9716e35f7bb8b50648201/_/download/contextbatch/css/customerportal,servicedesk.portal/batch.css?sd_operational=true" data-wrm-key="customerportal,servicedesk.portal" data-wrm-batch-type="context" media="all"&gt;

But, my CSS file is at the very bottom of the external link.  What makes it worse is that my CSS file is a simple line @import url ('');  and it many not load.  When I replace the import directive with the actual content of my CSS file, it works.  


Hi @Mina Samy

Can you confirm that this functionality is now available ?

Mina Samy Atlassian Team Aug 02, 2018

Yes, it is.

how to I use this??

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

We want to hear from you! How do you use Slack and Atlassian together?

Hi Everyone! My name is Mina and I am on Atlassian’s Ecosystems Marketing team. Our team is focused on our technology partnerships and marketplace apps. One of Atlassian’s partners is Slack, who ...

107 views 1 6
Join discussion

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