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

Accepted Answer
1 vote

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.

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.

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 votes

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 Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,947 views 2 7
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