Is it possible to automatically add predefined sub task to an issue?

Naama Lev
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.
October 1, 2015

Hello Experts, 

I would like that each new feature issue that is created will have already a set of predefined subtasks

Can you please advise if this is possible?

Thanks

Naama

5 answers

1 accepted

0 votes
Answer accepted
Jeremy Gaudet
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.
October 1, 2015

There's a "create subtask" pre-built script for workflow transitions; to create a subtask at create time, I'd imagine you'd use those (one per subtask) on the "Create" transition, which is available on the workflow editor if using graphical mode.  However, if "new feature" is a single issue type of many available in the project, you'd either have to script it yourself and restrict on issue type within the script, or else separate out the workflows such that you have one workflow for "new feature" and one workflow for everything else.  If it wasn't "Create Issue", you could add a condition and split them within the workflow, but there are no conditions on "Create Issue".

Separating the workflows (you assign the different workflows to different issue types in the project's workflow scheme) will mean changing issue types will require the "move issue" privilege, and you'll have to go through the move wizard to make sure JIRA knows how to transition between them properly.  It's a little clunky, hence scripting it as an inline script is the cleaner approach.

0 votes
Naama Lev
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.
October 7, 2015

Hi @Jeremy Gaudet

Thank you very much for your reply, 

I managed to find the issue - it was that the order of the post function was not right smile (first create the issue than create sub tasks...)

Thanks again

Naama

0 votes
Jeremy Gaudet
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.
October 6, 2015

The only thing that comes to mind is that the sub-task type needs to be part of the project's Issue Type Scheme.  Are you able to create those subtasks manually with the same data?  Beyond that, you could ask for access to the system logs, as JIRA should be logging any exceptions that are being thrown as a result.  I don't think required fields are relevant here as those are specific to the input form, but it's possible; you could try giving those (sub)issue types a separate workflow in the workflow scheme such that they have a form with no required fields, but that's mostly a shot in the dark.

Also, if you have specified a condition, you could try removing it to see if the 'basic' create works; if it does, then presumably your condition is not well formed and so is failing to evaluate to 'true'.

0 votes
Naama Lev
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.
October 6, 2015

Helo @Jeremy Gaudet @Bob Swift [Bob Swift Atlassian Add-ons]

Thank you very much for your reply,

I have tried to implement your suggestion by following the steps:

 

  1. Went to 'Create Issue' Transaction
  2. Add post function to create multiple subtasks
  3. add the following subtasks in the following syntax:
    -Create Functional Design
    -Create Test Case

     

How ever when i create new issue with that workflow - no new sub tasks are created, 

Can you please advise?

Thanks you 

Naama

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
October 1, 2015

Yes. Use Create on Transition for JIRA and the Create Subtask post function on the create issue transition conditioned by issue type being a New feature or whatever other conditions you want. References:

  1. How to condition the creation of issues
  2. How to create subtasks on initial issue create
  3. How to create multiple issues

 

 

Suggest an answer

Log in or Sign up to answer