Create Multiple Subtasks based on number field.

In create issue Screen, i have a Number field, which has below options

Options: 1,2,3,4,5,6,7,8,9,10 ...

User can be able to choose/tick as many options he wanted,

like if user enter: 4 - then i need to create 4 sub tasks.

if user enter: 6 - then i need to create 6 sub tasks.

if user enter: 10 - then i need to create 10 sub tasks.

Please help me on same

 

 

any one help me on above Requirement.

3 answers

If you need to create right after issue is create I suggest using Script Runner Plugin and add post-function groovy-script.
Another way is to create web-item plugin with action that creates subtasks, but this one has to be triggered manually.

Hi Andrey

below is my coding

 import com.atlassian.jira.issue.Issue

 import com.atlassian.jira.util.ImportUtils

import com.atlassian.jira.workflow.WorkflowTransitionUtil;

import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;

import com.atlassian.jira.util.JiraUtils;

import java.lang.Boolean;
cfLic = customFieldManager.getCustomFieldObjectByName("Number of Licenses")
Collection<User> users= (Collection) issue.getCustomFieldValue(cfLic);
if(users != null) { for(i in 0..users.size()-1) {

Object AssigneeValue = users.get(i).getName();
issueObject = issueFactory.getIssue()

 issueObject.setProject(issue.getProject())

 issueObject.setIssueTypeId("10417")

 issueObject.setParentId(issue.getId())
issueObject.setSummary(issue.getSummary()) issueObject.setAssigneeId(AssigneeValue)
subTask = issueManager.createIssue(authenticationContext.getUser(), issueObject) subTaskManager.createSubTaskIssueLink(issue.getGenericValue(), subTask, authenticationContext.getUser()) i++

}
}

not creating subtasks above code

please help me on above code. where I have to put code like Transition on button,create a subtask.....

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,982 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot