Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to open/access/render the IssueCRUD Servlet through a Web-Item inside a Project Template module?

Dhruv Dixit February 19, 2019

I have been trying to access/render the IssueCRUD servlet through a Web-Item module inside a Project Template created using Atlasssian SDK but it is showing the 404 error i.e. "Oops, you've found a dead link". Has anyone tried doing so?

Here is a part of "atlassian-plugin.xml" containing the web-item and the servlet:

<web-item name="project-web-item" i18n-name-key="project--web--item.name" key="project--web--item" section="jira.project.sidebar.plugins.navigation" weight="300">
<description key="project--web--item.description">The project-web-item Plugin</description>
<label key="project--web--item.label"/>
<link linkId="project--web--item-link">/plugins/servlet/issuecrud</link>
<param name="iconClass" value="aui-icon-large icon-sidebar-release"/>
</web-item>

 

<servlet name="Issue CRUD" i18n-name-key="issue-crud.name" key="issue-crud" class="com.example.plugins.tutorial.servlet.IssueCRUD">
<description key="issue-crud.description">The Issue CRUD Plugin</description>
<url-pattern>/issuecrud</url-pattern>
</servlet>

1 answer

1 accepted

0 votes
Answer accepted
Dhruv Dixit February 20, 2019

SOLVED: I was not importing the resources for the IssueCRUD servlet inside the project template plugin. There were some js, css, META-INF files which needed to be copied into the resources folder inside the project template plugin.

edwardgonen June 29, 2020

Hi,

A novice question. I've implemented a modified servlet that replaces the IssueCRUD. Just listing the issue.

Now the question is:

I have a web-item link in the Project view. And I added a web-panel (just simple page). I would like to display the output of the servlet in that web panel. How do I do that?

The plugin xml below allows me to press on the link (web item) and get the issues in a new screen. But I would like:

a. Forward the project name to the servlet

b. Display its output in the web panel - or whatever it is on the right side of the link

Here is my XML

<?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="playgilePlugin"/>
<!-- add our web resources -->
<web-resource key="playgilePlugin-resources" name="playgilePlugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="playgilePlugin.css" location="/css/playgilePlugin.css"/>
<resource type="download" name="playgilePlugin.js" location="/js/playgilePlugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>playgilePlugin</context>
</web-resource>
<web-item name="metrics-page-item" i18n-name-key="metrics--page--item.name" key="metrics--page--item" section="jira.project.sidebar.plugins.navigation" weight="1000">
<description key="metrics--page--item.description">The metrics-page-item Plugin</description>
<icon width="32" height="32">
<link linkId="metrics--page--item-icon">${baseurl}/download/resources/${atlassian.plugin.key}:playgilePlugin-resources/images/project-monitoring.png</link>
</icon>
<label key="metrics--page--item.label"/>
<!--link linkId="metrics--page--item-link">/projects/${pathEncodedProjectKey}?selectedItem=com.atlassian.jira.jira-projects-plugin:metrics-page</link-->
<link linkId="project--web--item-link">/plugins/servlet/projectmonitor</link>
</web-item>
<web-panel name="metrics-page" i18n-name-key="metrics--page.name" key="metrics--page" location="com.atlassian.jira.jira-projects-plugin:metrics-page" weight="1000">
<description key="metrics--page.description">Playgile Playground page</description>
<context-provider class="com.playgileplayground.jira.impl.MetricsInfoImpl"/>
<resource name="view" type="velocity" location="templates/tabpanels/metrics-tab-panel.vm"/>
</web-panel>
<servlet name="projectMonitor" class="com.playgileplayground.jira.servlets.ProjectMonitorServlet" key="projectmonitor">
<url-pattern>/projectmonitor</url-pattern>
<description key="project-monitor.description">The Issue CRUD Plugin</description>
</servlet>
</atlassian-plugin>

Suggest an answer

Log in or Sign up to answer