playing with database through projectTabPanel plugin

Hi everyone,

I'm actually developping an extension for Jira.

I created a projectTabPanel plugin because I needed to call my plugin from this emplacement. My plugin also created a new table in activeObjects and I want to interact with it.

No problem with that, I did some tests and it worked perfectly well.


My problem is that my projectTabPanel call my velocity template and this template have a form with data that I want to save in my new table.
Here's my question : how to send those data from this page ? Which java class will that call ?

Thanks a lot for your help and sorry for my english^^

3 answers

1 accepted

0 votes
Accepted answer

Create a webwork action class and invoke it from the form. You can then persist the data in the action class.


Hi Jobin,

Thanks for your answer.

Following your advices I read the documentation and created a WebWork plugin which I linked to a template and a Javascript function. JIRA compile well, unfortunatly the WebWork plugin doesn't work.

Here's my code :


<script type="text/javascript">
<h1> Release notes of version : </h1>
<select name="select">
  <option value=""></option> 
    #foreach($version in $versions)
        #if ( $version == $selected )
            <option value="$version" selected>$version</option> 
            <option value="$version">$version</option> 
<textarea rows="40" cols="100">$description2 , $QueryString, $contextKey, $url, $contextKey</textarea> 
 <button onclick="test()">ok </button>



<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${}" plugins-version="2">
    <vendor name="${}" url="${project.organization.url}"/>
    <param name="plugin-icon">images/pluginIcon.png</param>
    <param name="plugin-logo">images/pluginLogo.png</param>
  <!-- add our i18n resource -->
  <resource type="i18n" name="i18n" location="jira-version-plugin"/>
  <!-- add our web resources -->
  <web-resource key="jira-version-plugin-resources" name="jira-version-plugin Web Resources">
    <resource type="download" name="jira-version-plugin.css" location="/css/jira-version-plugin.css"/>
    <resource type="download" name="jira-version-plugin.js" location="/js/jira-version-plugin.js"/>
    <resource type="download" name="images/" location="/images"/>
  <!-- publish our component -->
  <component key="myPluginComponent" class="com.test.MyPluginComponentImpl" public="true">
  <!-- import from the product container -->
  <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/>
  <project-tabpanel key="release-plugin" name="Release Plugin" i18n-name-key="" class="com.test.jira.tabpanels.ReleasePlugin">
    <description key="release-plugin.description">The Release Plugin Plugin</description>
    <label key="release-plugin.label"/>
    <resource type="velocity" name="view" location="templates/tabpanels/release-plugin.vm"/>
    <web-resource key="ajax-actions">
      <resource type="download" name="jira-version-plugin.js" location="js/jira-version-plugin.js"/>
  <ao key="ao-module">
    <description>The module configuring the Active Objects service used by this plugin</description>
  <component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">
    <description>Component to access Active Objects functionality from the plugin</description>
  <webwork1 key="SaveEntity" name="SaveEntity" i18n-name-key="">
    <description key="SaveEntity.description">The SaveEntity Plugin</description>
      <action name="com.test.jira.tabpanels.SaveEntity" alias="SaveEntity">
        <view name="success">templates/tabpanels/release-plugin.vm</view>
           <command name="test" alias="SaveEntityOne">
            <view name="success">templates/tabpanels/release-plugin.vm</view>



import java.util.*;

import com.atlassian.activeobjects.external.ActiveObjects;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.ofbiz.OfBizDelegator;
import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.browse.BrowseContext;
import com.atlassian.jira.project.version.Version;
import com.atlassian.jira.web.action.JiraWebActionSupport;
import com.atlassian.query.Query;

public class SaveEntity extends JiraWebActionSupport {

    protected String doExecute() throws Exception {
        System.out.println("TEST SUCCEED");
        return SUCCESS;

    protected String doTest() throws Exception {
        System.out.println("TEST SUCCEED2");
        return SUCCESS;





function test() {
    alert("!!!!!!!hello world!!!!!!!!");
    window.location = "/SaveEntity!test"


When I load my template page doExecute isn't called. When I click on the javascript button I got the alert "hello world" but it does redirect me on a white page and not the same template as expected...
I have no idea why and no errors in the logs :/
Thanks again for your help !

This is not how you do things in webwork. But it is a lot to teach in a forum ;) For starters, you are redirecting to "/SaveEntity!test" which is wrong. It should be "JIRA_BASE_URL/secure/SaveEntity!test.jspa". You should also do it in a form action instead of redirecting from java script.

Once again you gave me the solution, a great thanks for that !

Nevertheless, I've got some others problem, here's the situation :

From the view of my projectTabPanelPlugin I submit a form to a class of a WebWork plugin.
I can do most of the stuff I wanted to do inside the class but here's not actually the problem.

When this class return the "success" statement I want to go back to the view of my projectTabPanel and it works, the problem is that my left side column menu disapeared, how to get it back ?

My other worry is this : in my view I got a textarea and I want to fill it with the result of some treatment I did in the class of my WebWork plugin. I know how to display variables in the view but I have no idea how to send those variables from my WebWork class :/

Thanks for your help =)

EDIT : I just found how to display parameters in my view, thanks to ${action.myMethod()} !

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,729 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you