The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to load JavaScript web-resource in JSD customer portal?

Adam Pryce
Contributor
April 13, 2017

I have a web resource defined as follows. alert.js properly loads and creates an alert on JIRA issue pages, but it doesn't load in the customer portal. What is the correct way to load resources/javascript on the customer portal?

 I have tried a variety of location designations, w/ and w/o the property, and some of the JSD customer portal specific contexts, but no luck.

    <web-resource key="my-plugin-resources" name="My Plugin Resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <resource type="download" location="/js/alert.js" name="alert.js">
            <property key="content-type" value="text/js"/>
        </resource>
        <context>atl.general</context>
        <context>servicedesk.general</context>
        <context>jira.general</context>
    </web-resource>

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

5 votes
Answer accepted
Vasyl Krokha
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 14, 2017

Hi Adam,

You should use:

<context>customerportal</context>
Adam Pryce
Contributor
April 17, 2017

Thanks! that was the trick!

Charles Rathert
May 23, 2018

We need to put our Chat Widget JS code on one of our customer portal pages but not all of them.  so we'd want the Chat deal to show up on http://*/servicedesk/customer/portal/35 but not http://*/servicedesk/customer/portal/36 etc.

Can anyone tell me where to put the code and how to do this?

Here is what Snap Engage instructions have

Place the SnapEngage widget on your website

Instructions:

  • Paste the code just above the closing </body> tag at the bottom of your HTML pages.
  • The code needs to be added to each page that you would like chat to be available.

<!-- begin SnapEngage code -->
<script type="text/javascript">
  (function() {
    var se = document.createElement('script'); se.type = 'text/javascript'; se.async = true;
    se.src='//storage.googleapis.com/code.snapengage.com/js/d63c37c0-ec7c-4549-9895-f3af51397da4.js';
    var done = false;
    se.onload = se.onreadystatechange = function() {
      if (!done&&(!this.readyState||this.readyState==='loaded'||this.readyState==='complete')) {
        done = true;
        /* Place your SnapEngage JS API code below */
        /* SnapEngage.allowChatSound(true); Example JS API: Enable sounds for Visitors. */
      }
    };
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(se, s);
  })();
</script>
<!-- end SnapEngage code -->

0 votes
Nicolas P
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 21, 2017

Hi there,

I'm trying to do the something similar on Jira Service Desk.
But it's not working ... :( I'm not sure my atlassian-plugin.xml is loaded..

Where should be this file ?
I put the file in jirasoftware/conf/atlassian-plugin.xml without editing any other file (web.xml, context ...)

Could you guys tell me if i'm right there ?
Thanks

TAGS
AUG Leaders

Atlassian Community Events