Is there a way to create sub-tasks for each of the selected issue fields? What should the Custom field type be?

Is there a way to create sub-tasks for each of the selected issue fields? What should the Custom field type be?

2 answers

1 accepted

Adding to Nic's answer and my understanding of what you are trying to do:

In the parent task, you have a custom field called "Create Subtasks?" with two checkbox options "Yes" and "No".

Now if the "Yes" option is checked you want to be able to create subtasks to this parent issue.

Very basic answer would be you write a workflow post-function to do this.

And by your statement "needs to create sub-tasks and assign to various users", I am assuming you have a few custom fields of user select type.

Again the whole answer is based on assumptions :) . The question is not clear enough.

Exactly, it's all a bit too vague for us to construct a decent answer. I would also have guessed that you wanted something like what @nbhushan has suggested, but we can't assume that from your question or comment (and I've been caught out making assumptions like that before, ending up giving completely inappropriate advice because the questioner wasn't clear)

Nic/nbhushan,

I have a transition called Terminate User. On clicking the button, I am presented with the screen where I have the field 'Retrieve Equipment', 'Retrieve Keys Issued', 'Terminate access to so and so account' etc., All these tasks should be done by different persons.

When the main person who is doing this transition 'Terminate User' selects or chooses the above mentioned fields, automatically sub-tasks should be created and should be assigned to respective owner. Can this be achieved? If yes, what type of fields should I use in the screen to achieve this? After this post, I have also looked at create-on-transition plugin but am not completly sure on how to do this.

I hope I am clear this time. Thank you for your time and help.

Thank you for your response. I shall take a look at it.

Dieter Community Champion Oct 16, 2012
As i understand the csot plugin it should allow you to define the subtask assignee as the value of a user picker custom field in the parent issue. just use %customfieldname% as the valur of the subtask assignee

haven't tried it yet but the documentation at https://bobswift.atlassian.net/wiki/display/CSOT/Create+on+Transition+Plugin+for+JIRA?desktop=true tells to do it that way.

Ah, now that's clear. You want something that will create one sub-task for each "ticked box". The plugin Dieter points you at will do MOST of the work, most importantly, the harder bit of creating the issues.

However, it's not quite what you need. If you add (say) three copies of it, it will create three subtasks every time you run it. It does NOT read another field to decide whether to run, it simply creates a task every single time it runs.

You'll need some extra code that will read your custom field and decide whether to trigger the sub-task creation.

Dieter Community Champion Oct 17, 2012
Your point is right, Nic. But instead having a tick box one might also have two transitions, one that creates subtasks and one that does not. The one that does not create subtasks would not have the user picker fields on the screen. One might also think of creating a set of transitions, each one having a set of user picker fields serving as source for subtasks. Using JSU one could write validators that make sure all these user picker fields are not empty.Using groovy one could implement a validator that makes sure users are not duplicated over the user picker fields (separation of duties)

Indeed.

You could also leave the boxes off the screen entirely and put in a transition back to the same status. One for each subtask type that needs doing, which uses the CSOT and then sets the tick-box, and another transition that has conditions like "not allowed if sub tasks are open" and "not allowed if there are no subtasks"

I think there's a lot of options, but to get to the exact requirement, there's going to be a little bit of coding somewhere.

Thank you so much for all of your suggestions. The requirement changed and I have chosen groovy script to do this.

Regards,

0 vote

I'm not sure the question makes a lot of sense.

I understand you want to create sub-tasks, but what has that got to do with fields? A sub-task belongs to an issue, you create them by adding them to issues, they have nothing to do with fields.

To expand the questions: Where are you selecting issue fields? What does a "selected" field do? What's the expected behaviour? What triggers a sub-task?

Nic,

I should have a checklist which when selected/completed and transitioned to next step needs to create sub-tasks and assign to various users. Custom fields are on the issue screen.

Thank you.

But what have the fields got to do with the subtasks? A check list is a field, or set of fields. Nothing to do with sub-tasks. Please explain the behaviour you are looking for?

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 ...

3,304 views 14 20
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