Issue Description:
We have developed a custom button within the Jira project settings that is intended to showcase content on the right side of the settings page, similar to the ‘Users and Roles’ section. However, the button currently causes a redirect to an entirely new page instead of displaying the desired content inline within the existing project settings.
Current Implementation:
We have created a custom web section and item, as indicated below:
<web-section key="custom-project-settings-section" location="atl.jira.proj.config">
<label key="custom.project.settings.section.label"/>
</web-section>
<web-item key="custom-project-settings-item" section="atl.jira.proj.config/custom-project-settings-section" weight="1000">
<label key="custom.project.settings.item.label"/>
<link linkId="custom-project-settings-link">/plugins/servlet/project-config/${project.key}/EntryPointServlet?projectKey=$projectKeyEncoded&projectId=$project.id</link>
</web-item>
Servlet Method Example:
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ApplicationUser currentUser = authenticationContext.getLoggedInUser();
ProjectManager projManager = ComponentAccessor.getComponent(ProjectManager.class);
ProjectRoleManager roleManager = ComponentAccessor.getComponent(ProjectRoleManager.class);
ProjectRole adminRole = roleManager.getProjectRole("Administrators");
if (roleManager.isUserInProjectRole(currentUser, adminRole, projManager.getProjectByCurrentKeyIgnoreCase(projectKey))) {
templateRenderer.render("templates/custom-project-settings.vm", map, response.getWriter());
} else {
redirectToLogin(request, response);
}
}
Problem Identified:
Although the button and servlet function correctly, the unwanted navigation to a new page occurs instead of loading the content within the project settings page itself.
Desired Outcome:
The goal is for the custom button to render content in the right section of the project settings page, allowing users to remain on that page without launching a new one, preserving the other project setting options in the sidebar.