Only web panel content loaded when opening an issue page

Hi everyone,

I have a strange problem and I don’t know how to fix it.

I added a web panel on the right context of the issue and a velocity view resource.

When I open the project address (i.e. …/jira/projects/TEST/issues/TEST-1) everything is fine with the page and the web panel context as expected.

But, if I open the issue directly (i.e. …/jira/browse/TEST-1) only my web panel context content is loaded on a grey background, all the rest of the issue page is missing.

I created a small example to reproduce this.

‘webpanel’-section in the atlassian-plugin.xml:

<web-panel name="issuewebpanel" i18n-name-key="" key="issuewebpanel" location="atl.jira.view.issue.right.context" weight="1000">
  <description key="issuewebpanel.description">The issuewebpanel Plugin</description>
  <context-provider class=""/>
  <resource name="view" type="velocity" location="/templates/view.html"/>

The simple context provider class:


import com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider;
import com.atlassian.jira.plugin.webfragment.model.JiraHelper;
import com.atlassian.jira.user.ApplicationUser;

import java.util.TreeMap;
import java.util.Map;

public class WebPanelContextProvider extends AbstractJiraContextProvider

  public Map getContextMap(ApplicationUser user, JiraHelper jiraHelper)
    Map contextMap = new TreeMap();

    contextMap.put("entry", "Hello World!");

    return contextMap;

The view template file:

    <p>Say 'hallo': $entry</p>

Now I made two screenshots to show what is happening:
(Had to put both in one picture because of forum limitations)

The following screenshot shows the difference between the project and issue page:

When opening the issue page only the webpanel content is loaded and all the rest of the jira page for this issue is missing! :confused:

Can anyone please help me?

I haven’t dug into it much, but my guess is that sitemesh is confused. Try removing the html, head and body tags from your view template. ie:

    <p>Say 'hallo': $entry</p>

should be

    <p>Say 'hallo': $entry</p>

I suspect things will work after that.

1 Like

Hi Daniel,

thanks a lot for this solution!

Problem is fixed. :slight_smile:

Did not had an eye on this malformed velocity file.

Kind regards