Hello!
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.
Thanks,
Josh
Community moderators have prevented the ability to post new answers.
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?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is probably a good idea to have a read of this guide: https://developer.atlassian.com/display/jiradev/web+resource+plugin+module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
atlassian-plugin.xml:
<web-resource name="Resources" key="resources"> <resource name="portal.js" type="download" location="portal.js"> </resource> <context> customerportal </context> </web-resource>
portal.js:
$(document).ready(function() { if(window.location == "https://jiratest.domain.com/servicedesk/customer/portal/1/create/83") {window.location.href = "https://redirecturlcom"} if(window.location == "https://jiratest.domain.com/servicedesk/customer/portal/1/create/82") {window.location.href = "https://redirecturl.com"} });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
<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">
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 ('https://www.example.com');
and it many not load. When I replace the import directive with the actual content of my CSS file, it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.