Issue page is empty when custom plugin is enabled

Иван Лучкин March 7, 2021

I am trying to develop my custom plugin to modify the issue view page. After messing around with OSGi to finally get my plugin enabled, I have found out that issue views are completely empty and log files only contain some warnings, which are not related to my plugin.

When viewing all issues in the project, the issue view is loaded just fine and the header of my plugin is displayed as expected. I have some exception in web developer tools in my browser, could it somehow be relevant to the problem?

1 answer

1 accepted

1 vote
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2021

Hi @Иван Лучкин could you write down the dev tools expcetions?

Иван Лучкин March 7, 2021

jira.png

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2021

What if you disable your App? Is this error gone? Do you use any Javascript in your App? Can you share its code?

Иван Лучкин March 7, 2021

After the plugin is disabled, the issue view is getting loaded and the error is gone. I do not use any JavaScript, but since I have created a plugin skeleton using atlas commands there is an empty .js file, which is getting loaded as a resource.

The only thing I have (apart from Java code) is a velocity template

UPD. I'm trying to locate my plugin to the

atl.jira.view.issue.right.context

location.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2021

CAn you share your atlassian-plugin.xml and velocity template file?

Иван Лучкин March 7, 2021

Plugin descriptor

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="myPlugin"/>
<!-- add our web resources -->
<web-resource key="myPlugin-resources" name="myPlugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="myPlugin.css" location="/css/myPlugin.css"/>
<resource type="download" name="myPlugin.js" location="/js/myPlugin.js"/>
<resource type="download" name="images/" location="/images"/>
<resource type="download" name="templates" location="/templates"/>
<context>myPlugin</context>
</web-resource>

<web-panel name="LocalTimeIndicator" i18n-name-key="local-time-indicator.name" key="local-time-indicator" location="atl.jira.view.issue.right.context" weight="1000">
<description key="local-time-indicator.description">The LocalTimeIndicator Plugin</description>
<context-provider class="com.atlassian.tutorial.myPlugin.impl.LocalTimeIndicatorPluginImpl"/>
<resource name="view" type="velocity" location="templates/local-time-indicator.vm"/>
<label key="local-time-indicator.title"/>
</web-panel>

</atlassian-plugin>

Velocity template

<html>
<head>
<title>Local time indicator</title>
</head>
<body>
<table>
<tbody id="results">
#foreach ( $result in $results )
<tr>
<td>$result</td>
</tr>
#end
</tbody>
</table>
</body>
</html>
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2021

I have two ideas:

  1. you identify your resources with prefix myPlugin. I think it is some "tutorial" value and it can be used by anyone. Maybe you implemented something already which has similar naming. I would change it to something more individual like locaTimeIndicator-resources
  2. I guess, template displayed as part of the issue should not contain "html" part. So following html is enough:
    1. <table>
      <tbody id="results">
      #foreach ( $result in $results )
      <tr>
      <td>$result</td>
      </tr>
      #end
      </tbody>
      </table>
Like Иван Лучкин likes this
Иван Лучкин March 8, 2021

Martin, thank you very much! Removing those tags solved my issue.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2021

Cool,you are welcome...happy to help 🙂

Suggest an answer

Log in or Sign up to answer