Only web panel content loaded when opening an issue directly.

Dennis Meins February 28, 2018

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. 

Do I need to add any decorator to my velocity file?

 

Kind regards,

Dennis 

2 answers

0 votes
Dennis Meins March 5, 2018

Hi again,

I still did not found a solution for this problem.

I created a small 'webpanel' example to reproduce this behavior.

'webpanel'-section in the atlassian-plugin.xml:

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

 The simple context provider class:

package com.it.dev.webpanelexample;

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
{

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

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

return contextMap;
}
}

The view template file:

<html>
<head>
</head>
<body>
<p>Say 'hallo': $entry</p>
</body>
</html>

 

Now I made two screenshots to show what is happening:

The following screenshot shows the jira page when opening the whole project. So everything is as expected :). Here .../jira/projects/TEST/issues/TEST-1.

project_page.jpg

But the next screenshot shows my problem when opening an issue page, here .../jira/browse/TEST-1. Only the content of the webpanel view template is loaded with the standard nav bar on  top.

issue_page.jpg

All the rest of the jira page for this issue is missing! :/

 

Can anyone please help me?

Dennis Meins March 5, 2018

I'm using 'atlas-run' to start the jira instance!

Dennis Meins March 6, 2018

The problem is fixed! :)

It is only allowed to fill the "body"-part of the html in the velocity file.

So:

<html>
<head>
</head>
<body>
<p>Say 'hallo': $entry</p>
</body>
</html>

has to be only: 

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

 

The extra <html>, <head> and <body> tags seem to confuse the site constructor.

0 votes
Danyal Iqbal
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.
February 28, 2018

which <location>?

Dennis Meins February 28, 2018

location="atl.jira.view.issue.right.context"

Suggest an answer

Log in or Sign up to answer