How can I allow the user to manually trigger the creation of multiple subtasks for an issue?

Rick Trudeau January 23, 2012

I'm interested in a way of allowing users to automatically create multiple subtasks for an issue, but only if the user manually triggers it.

In my case, I don't want the subtasks automatically created when the issue is created. Instead, I want the user to drive the creation only if he wants the subtasks. So, for instance, if the parent issue had a new button/menu item that the user could press to trigger the auto-creation of the subtasks, that would be ideal.

Since I want this to be user driven, I don't want to trigger the auto-create function off a transition.

Any clues on how to integrate a script that would allow this via user driven interface?

1 answer

1 accepted

0 votes
Answer accepted
Bob Swift (personal)
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.
January 23, 2012
See my comment on the other question you posted
Rick Trudeau January 23, 2012

Thanks Bob, and or the sake of completeness, I'll post your answer here:

"You can have a transition that does not actually change the state and associate any post functions you like including create on transition plugin post function to add one or more subtasks"

So if I understand your suggestion correctly, I would create a workflow transition from State1 to State1, and bind a post function to it that would trigger the creation of the subtasks. That way a user could select the transition from the menu and have the tasks auto-created?

Bob Swift (personal)
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.
January 23, 2012
Yes. A create sub task post function for each subtask you want.
Rick Trudeau January 23, 2012

Yes, thanks again. I think that will work.

One gotcha I'm running into is that when creating the subtask I want to copy to it some custom field values from the parent issue. What I'm finding is that when I try to get to the parent object from within the subTask post function context, I get a null returned. I'm guessing that the binding of the parent to the subTask probably isn't complete until after the subTask is created?

So maybe I need a primary post function to first create the subtask and then a secondary post function to go and modify the created subtask?

Rick Trudeau January 24, 2012

Another gotcha related to the Post Function that creates a subtask...wondering if anyone has any ideas.

We use GreenHopper to make use of its Ranking capability. When I use the native "Create Subtask" function from an issue, the subtask is created and it takes a rank of (parentIssueRank +1) so that the rank of subtasks always follow the rank of the parent backlog. However, if I use the post function to create a subtask, it looks like the newly created subtask takes the rank of the parent issue and the parent issue gets bumped down, leaving the subtask with a higher rank than the parent issue. This has the unwanted side effect of issues and subtasks not being properly sorted in the GreenHopper Agile view.

Does anyone have any experience with this? Is it possible to have the post function use the same ranking mechanism as the native "create subtask" menu item?

Bob Swift (personal)
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.
January 25, 2012

Probably needs an improvement for the Create on Transition plugin. Write one up and I will investigate.

Rick Trudeau January 29, 2012

Thanks Bob, I went ahead and created: https://studio.plugins.atlassian.com/browse/CSOT-14

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events