Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

jira 3.13.1 create subtask plugin helpppp

mohammed idrissi June 29, 2011

hi verybody

i'm searching for some code to create a plugin that creates issue's subtask , i mean that i want 2 combobox (one of project) (2 of issues of the project selected ) and textfield to write a name of the subtask and a submit button to create the subtask ... please help me i'm so bigginer and i need details

thank you all

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Edwin Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2011

There's an existing plugin for creating subtask on a transition: https://studio.plugins.atlassian.com/wiki/display/CSOT/Jira+Create+Subtask+for+transition. Perhaps you can use it as a guide if you want to make your own.

mohammed idrissi June 30, 2011

hi eykchan

thank you for your answer .

i installed the plugin but i don't know how to use it in my jira dashboard can i add a link for it in my system.admin to call it when i want ?? if yes , how ? thank you again

0 votes
Daniel Rinaldi November 30, 2012

Hi mohammed,

I am assuming you want to make this on the dashboard. In that case you should look up creating a jira gadget for your dashboard ----> https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Writing+Gadgets+for+JIRA (they're pretty neat!). from here just create a class that extends httpServlet and place a [location.redirect("/plugins/servlet/'yourServlet'");] in the content part of the gadget.xml

In your servlet write:

ServletOutputStream out = response.getOutputStream();

Then you can simply print html code to the screen using the ServletOutputStream object's print method!

In your case you can create 2 dropdown selectboxes and fill them with projects and issues using jira's api and an input text field for the new subtask. Also your submit button can be in a form that either posts back to the same servlet or another one where you use the api to create a subtask.

Here is a very brief example:

Collection<Project> jiraProjects = ComponentManager.getInstance().getProjectManager().getProjectObjects(); 

String output = "<select id='project' name='project'>";

loop through the collection...


Project proj = iterator.next();
output += "<option value='"+proj.getKey()+"'>"+proj.getKey()+"</option>";

loop through the collection...

output += "</select><br />";

out.print(output);

I hope that the above explanation helps, I've used this same logic to make a gadget that creates a bug in the selected issue which was fairly simple to do! If you have any other questions reply back and ill try to answer them as best i can.

TAGS
AUG Leaders

Atlassian Community Events