Accessing HTML page

Ali June 8, 2023

Hello there,

I have a question.
how can I access html page from my addon. Knowing that the URL I have is : si/jira.issueviews:issue-html

this is my atlassian-plugin

<web-resource key="issue-tracker-helper" name="Issue Tracker Helper">
<resource type="download" name="issue-html.css" location="/css/issue-html.css"/>
<resource type="download" name="rtl-content.js" location="/js/rtl-content.js"/>
<context>jira.issueviews:issue-html</context>
</web-resource>

here cannot read the JS file and CSS file as well.
 thanks

2 answers

0 votes
said kouzibry
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 Leaders.
June 9, 2023

if you need the url to the CSS file it should be something like this

/download/resources/[addon key]:issue-tracker-helper/issue-html.css

Where [addon key] is your plugin key and issue-tracker-helper is your web-ressource key.

Ali June 9, 2023

Thank you @said kouzibry 

can u give me the full code of this

/download/resources/[addon key]:issue-tracker-helper/issue-html.css

and where should I paste it ?

after that how can I access its CSS from my Addon ?

0 votes
said kouzibry
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 Leaders.
June 8, 2023

Hello @Ali 
Normally you'd have on your "atlassian-plugin.xml" file the following

<servlet name="My Servlet" i18n-name-key="my-servlet.name" key="my-servlet" class="ma.azara.tutorial.servlet.MyServlet">

    <description key="my-servlet.description">The My Servlet Plugin</description>  

    <url-pattern>/myservlet</url-pattern>  

  </servlet>
Which should give you the url of the servlet at url-pattern,
Then if you have a web item pointing to that servlet you'd have something like this
 <web-item name="myplugin" i18n-name-key="myplugin.name" key="myplugin" section="admin_plugins_menu/myplugin" weight="1000"
    application="jira">

    <description key="myplugin.description">myplugin</description>  

    <label key="myplugin"/>  

    <link linkId="myplugin-link">/plugins/servlet/myservlet</link>

  </web-item>

Which should give you the url of the web item at <link>.

That being said, I am not sure I understand well, do you want to access your html files from Jira after the addon is built or are you looking for the resource files in the directory tree of your plugin ?

If the latter, then typically you'd have it setup like this : 
Plugin folder -> src -> main -> resources -> ...
In your resources folder, you'll find some directories that might contain the files you are looking for, CSS, JS, Templates....

Code_UMUJQj0TTi.png

Also typically html pages are not stored as html but rather some templating format like velocity of closure (.soy).

I hope this helps.

Ali June 9, 2023

hello @said kouzibry ,

if you can see the link above si/jira.issueviews:issue-html. This Link is in Jira instance once I want to print Issue.
My Addon is responsible to make Jira RTL.
Every pages are RTL expect this page....
How can I access its CSS ?
Should I follow your reply or you have another approach ?


regards

Like said kouzibry likes this
said kouzibry
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 Leaders.
June 9, 2023

My apologize, I misunderstood what you needed,

if you need the url to the CSS file it should be something like this

/download/resources/[addon key]:issue-tracker-helper/issue-html.css

Where [addon key] is your plugin key and issue-tracker-helper is your web-ressource key.

I will post this as a separate answer so that you can accept it to help other members.

Like Ali likes this
Ali June 9, 2023

Thank you @said kouzibry 

can u give me the full code of this

/download/resources/[addon key]:issue-tracker-helper/issue-html.css

and where should I paste it ?

after that how can I access its CSS from my Addon ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9
TAGS
AUG Leaders

Atlassian Community Events