Recipes‎ > ‎Programming‎ > ‎

Jira Plugins

I'm using Eclipse 3.5 Galileo, following instructions per

(0) Downloaded the Jira SDK and installed under ~/Jira/atlassian-plugin-sdk-3.0.5

(1) Installed m2eclipse plugin.  This required a considerable amount of searching for software install sources for a number of different projects.  I used these software sources to install the necessary packages from within the Eclipse software installer.

(2) Set the Maven installation directory, as apparently you need to use the one supplied with the Jira SDK

(3) Now following instructions per

Added to ~/.bashrc:
export PATH=$PATH:~/Jira/atlassian-plugin-sdk-3.0.5/bin

$ mkdir ~/Jira/helloworld
$ cd !$
$ atlas-create-jira-plugin

groupId: com.[...].jira.plugins
artifactId: helloworld
version: 1.0-SNAPSHOT
package: com.[...].jira.plugins

$ atlas-run

Hurray!  The plugin appears in the plugins list.  A good moment, 4+ hours of work to get here.  (The default p/w appears to be admin/admin.)

(4) Actual plugin development!

... 4 hours later ...

ah har har har har only joking har har


<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.artifactId}" plugins-version="2" class="com.insuremytrip.jira.plugins.TTPriorityField">
        <vendor name="${}" url="${project.organization.url}" />
        <resource type="velocity" name="column-view" location="templates/plugins/fields/view/view-ttpriority.vm"/>
        <resource type="velocity" name="xml" location="templates/plugins/fields/view/xml-ttpriority.vm"/>
</atlassian-plugin> (copied from comments on the tutorial page):

package com.[...].jira.plugins;

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.comments.Comment;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.customfields.impl.CalculatedCFType;
import com.atlassian.jira.issue.fields.CustomField;
import com.opensymphony.user.EntityNotFoundException;
import com.opensymphony.user.User;
import com.opensymphony.user.UserManager;
import java.util.List;

public  class TTPriorityField extends CalculatedCFType 
private JiraAuthenticationContext authenticationContext = null;
private CommentManager commentManager = null;
private UserManager userManager = null;
* Picocontainer should populate this
* @see "" />
* @param authenticationContext authentication Context
* @param commentManager comment Manager
* @param userManager user manager
public TTPriorityField(JiraAuthenticationContext authenticationContext, CommentManager commentManager, UserManager userManager) {
this.authenticationContext = authenticationContext;
this.commentManager = commentManager;
this.userManager = userManager;
public Object getValueFromIssue(CustomField field, Issue issue) {
User lastUser = null;
List comments = commentManager.getCommentsForUser(issue, authenticationContext.getUser());
if(comments != null && !comments.isEmpty()) {
Comment lastComment = (Comment)comments.get(comments.size() - 1);
try {
lastUser = userManager.getUser(lastComment.getAuthor());
catch(EntityNotFoundException e) {
return lastUser;
/** not sure what this does...doesn't ever seem to get called...but must exist */
public String getStringFromSingularObject(Object customFieldObject) 
return customFieldObject.toString();
/** not sure what this does...doesn't ever seem to get called...but must exist */
public Object getSingularObjectFromString(String customFieldObject) 
return customFieldObject;

$ rm -rv target
$ atlas-compile
$ atlas-run