add new item in project admin

artafon September 5, 2018

Hi!

I'll try to add new item with correct jira url. Existing item have a link for example /plugins/servlet/project-config/PRJ/summary

There are so much information about how to link new item with link /secure/item.jspa. But I think it's incorrect. I want to add new item to access for example /plugins/servlet/project-config/PRJ/fields-item

could you help me please?

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2018

Adding new pages and urls in add-ons is usually done by defining a servlet - see https://developer.atlassian.com/server/jira/platform/servlet/

artafon September 8, 2018

Nic, Hi! Thanks for your attention. But I'm still not understand how to get correct url wit current project key. I read about servlet and try to add new item

artafon September 11, 2018

Resolved.

atlassian-plugin.xml

<web-item name="FieldsItem" i18n-name-key="fields-item.name" key="fields-item" section="atl.jira.proj.config/projectgroup3" weight="1000"> <description key="fields-item.description">The FieldsItem Plugin</description> <label key="fields-item.label"></label> <link linkId="fields-item-link">/secure/ActionsAction.jspa</link> </web-item>

 tab.vm

<!DOCTYPE HTML> <html> <head> <title>MyTestPage</title> <meta name="decorator" content="atl.admin"/> <meta name="projectKey" content="$selectedProject.key"/> <meta name="projectId" content="$selectedProject.id"/> <meta name="admin.active.tab" content="fields-item-link"/> <meta name="admin.active.section" content="atl.jira.proj.config"/> $webResourceManager.requireResourcesForContext("my-resources") </head> <body> <div style = "text-align:center; padding: 2px;"> <img src="$req.contextPath/download/resources/com.atlassian.tutorial.DBFrame:DBFrame-resources/images/picture.gif" alt="Picture"> </div> </body> </html>

action.java

package com.atlassian.tutorial.jira.webwork; import com.atlassian.jira.project.Project; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.atlassian.jira.web.action.JiraWebActionSupport; public class ActionsAction extends JiraWebActionSupport { private static final Logger log = LoggerFactory.getLogger(ActionsAction.class); private Project project; @Override public String execute() throws Exception { project = getSelectedProjectObject(); //noinspection deprecation request.setAttribute("com.atlassian.jira.projectconfig.util.ServletRequestProjectConfigRequestCache:project", project); return super.execute(); //returns SUCCESS } }
0 votes
artafon September 7, 2018

Any idea dear friends?)

Suggest an answer

Log in or Sign up to answer