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?
Adding new pages and urls in add-ons is usually done by defining a servlet - see https://developer.atlassian.com/server/jira/platform/servlet/
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.