How to write JavaScript at the portal of JSD?

I want to alert some message to users who viewed the articles of KnowledgeBase to click the helpful feedback button at portal of JSD.
So is there any way to surport that?
I will be very grateful for someone’s answer.

Hi Ming,

You can define a web-resource in your atlassian-plugin.xml. The context of this resource should be customerportal, so your resource will be available at any customer portal.

<!-- Customer Portal web resource -->
<web-resource key="customer-portal-resources" name="Web Resources for customer portal">
  <resource type="download" name="script.js" location="/js/script.js"/>
  <context>customerportal</context>
</web-resource>

This script.js file will be loaded when you open the portal.

How to find my atlassian-plugin.xml ? I am not able to find it in Jira Server Prod Environment.

Hi @MingP,

I saw the tag JSD Development in the Developer Community so I thought you asked about app (plugin) development.

JSD does not support to inject JS code into the customer portal, please read this answer: https://community.atlassian.com/t5/Jira-Service-Desk-questions/How-can-I-add-Javascript-to-Customer-Portal/qaq-p/187461#M1909

BTW: We can write a P2 plugin to do this!