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
Community moderators have prevented the ability to post new answers.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.