I followed this extremely simple tutorial https://bitbucket.org/bhushan154/jira-issue-tab-panel-tutorial/wiki/Home to add a new issue tab panel. It shows how you can add simple content to the page using stringBuilder. Ideally I would want to use a velocity template as it's much easier to work with and separates the logic appropriately. I have a template file, that contains:
<div class="mod-header">
<h3>$i18n.getText('service-now-tab-panel.label')</h3>
</div>
I've tried fiddeling around with this attempting to get it to display data appropriately, it's not doing anything and isn't rendering out content onto the issue detail page. Here's the controllers it's barebones right now as I need to get passed this road block.
package com.verys.jira.plugins.panels;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.atlassian.jira.plugin.issuetabpanel.AbstractIssueTabPanel;
import com.atlassian.jira.plugin.issuetabpanel.IssueTabPanel;
import com.atlassian.jira.issue.tabpanels.GenericMessageAction;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.crowd.embedded.api.User;
import java.util.Collections;
import java.util.List;
public class ServiceNowTabPanel extends AbstractIssueTabPanel implements IssueTabPanel
{
private static final Logger log = LoggerFactory.getLogger(ServiceNowTabPanel.class);
public List getActions(Issue issue, User remoteUser)
{
return Collections.singletonList(new GenericMessageAction("" + issue.getReporter().getDisplayName() + ""));
}
public boolean showPanel(Issue issue, User remoteUser)
{
return true;
}
}
The documentation for rendering out velocity templates on issue tab panels is extremely sparse and almost non existent. If someone can just kindly point me in the right direction that would be great. Also here is the properties file
<issue-tabpanel key="service-now-tab-panel" name="Service Now Tab Panel" i18n-name-key="service-now-tab-panel.name" class="com.verys.jira.plugins.panels.ServiceNowTabPanel">
<description key="service-now-tab-panel.description">The Service Now Tab Panel Plugin</description>
<label key="service-now-tab-panel.label">Plugin Test</label>
<order>10</order>
<resource type="velocity" name="view" location="templates/tabpanels/service-now-tab-panel.vm"/>
<supports-ajax-load>true</supports-ajax-load>
</issue-tabpanel>