Prompt for creation of subtask?

Issue #563 resolved
Scott McDonald created an issue

Hello -

Please let me know if there is a way to complete this use case - thank you!

If a "yes" choice is selected from a multi-select field at the time of create, a prompt at forces the creation of subtask(s) , preferably immediately so the work can be assigned and would start showing up in the backlog for the given resource and would block closure of the story until complete.

Comments (10)

  1. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    You can't prompt the user to create subtasks in the create issue screen, but you can use "Create issues and subtasks" for creating the sub-tasks based on the content of a one or more fields filled-up by the user in the issue create screen.

    You can use a Boolean validator with math, date-time or text-string terms validation at Create Issue transition with a boolean expression like this:

    "Yes" in %{aaaaa} IMPLIES %{bbbbb} != null
    

    where aaaaa is the Multi-Select custom field, and bbbbb is a Text Field (Multi-Line) called New subtasks. You can create a subtask, for each line in New subtasks field. The content of the line could be the summary of each subtask. To do it you should use a configuration like this one:

    Captura de pantalla 2017-03-29 a las 23.52.12.png

    where bbbbb is field code for New subtasks custom field.

  2. Scott McDonald reporter

    You can't prompt the user to create subtasks in the create issue screen, but you can use "Create issues and subtasks" for creating the sub-tasks based on the content of a one or more fields filled-up by the user in the issue create screen.

    Can you please explain the above comment? Thank you!

  3. Fidel Castro Armario repo owner

    You can add create screen a Text (Multi-Line) custom field called "Subtasks to be created" (the name doesn't actually matter). We can use "Create issues and subtasks" post-function in order to automatically create a sub-task for each line entered in that field at the moment of issue creation. We use the text in each line of the field as summary of each new subtask.

    The configuration of "Create issues and subtasks" post-function shown in the screenshot of my previous post is all what you need to implement the described behavior.

  4. Scott McDonald reporter

    Since I am dealing with a multi-select field, it appears i'll want to use the option of Multiple Issues based on seeds :JQL query then use the query "Embedded Automation" in (Yes, No)? What other options do I need to set/use in order to get a sub-task created if a value of Yes or No selected in the Embedded Automation?

  5. Fidel Castro Armario repo owner

    If you want to create issues only when Select List field "Embedded Automation" is "Yes", then you should set parameter "Conditional execution" with the following boolean expression: %{nnnnn} = "Yes", where nnnnn is field code for "Embedded Automation" custom field.

    I'm assuming that "Embedded Automation" is a Select List because only options "Yes" and "No" are available. In case it actually is a Multi-Select List, then use %{nnnnn} ~ "Yes" boolean expression.

    Parameter "Issues to be created" should be configured as I explained in my first post, in case you want to create a sub-tasks for each line filled up in a custom field.

  6. Scott McDonald reporter

    Sorry, I'm having issues following you on this one. It appears you are suggesting use of 2 different functions (one validation rule and one post-function), which are Boolean validator...and Create Issue...Is that correct?

  7. Fidel Castro Armario repo owner

    All the JIRA Workflow Toolbox's post-functions provide a parameter called "Conditional execution". This parameter consists in a boolean expression that is evaluated in order to decide whether the post-function is actually executed (when trueis returned) or not (when false is returned).

    I'm asking you to use that parameter in order to execute post-function "Create issues and subtasks" only when "Embedded Automation" contains "Yes".

  8. Scott McDonald reporter

    I think I see why I'm getting tripped up. The screenshot above is a little different then the functionality I have available. When I add 'Create issues and subtasks' function, I am presented this screen: Screen Shot 2017-04-05 at 8.29.58 AM.png Screen Shot 2017-04-05 at 8.34.45 AM.png

    Do I need to add this expression to the conditional execution? "Yes" in %{aaaaa} IMPLIES %{bbbbb} != null

    Again, my use case is: If a "yes" choice is selected from a multi-select field at the time of create, a prompt at forces the creation of subtask(s) , preferably immediately so the work can be assigned and would start showing up in the backlog for the given resource and would block closure of the story until complete.

  9. Fidel Castro Armario repo owner

    Hi Scott,

    Sorry, I made a mistake in my explanations. Use the following solution:

    1) Add "Boolean validator with math, date-time or text-string terms" to "Create Issue" transition with the following configuration:

    • Boolean expression:
    "Yes" in %{aaaaa} IMPLIES %{bbbbb} != null
    

    where aaaaa is "Embedded Automation" custom field, and bbbbb is a Text Field (Multi-Line) called "New subtasks".

    2) Add "Create issues and subtasks" post-function to Create Issue transition (do it AFTER "Creates the issue originally" post-function). Use the configuration I described in my first post.

    Once you get it working, we can complicate it a bit, allowing to set also the assignee of each new subtask by adding it at the end of each line of field New subtasks, something like:

    Clean the kitchen, john.neuman
    Buy some bread, mary.poppins
    Cut the grass, edward.scissorhands
    

    I will explain how to do it in case you need it.

  10. Log in to comment