Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Autogenerate Jira Epic-Story-Task-Subtask based on variable selections

Laurie Sciutti
Community Champion
October 22, 2021

I have a request for an Epic template that auto-generates Stories, Tasks and Sub-Tasks depending on variable selections in the Epic template (non db fields:  variables in Issue Templates and Script fields in ScriptRunner).  I know this is possible using ScriptRunner but I’m very new to Groovy scripting.  I have looked through the documentation and wondering if I can utilize the Dynamic Forms functionality for the variables and https://deviniti.com/support/addon/server/issue-templates/latest/groovy/#copy-sub-tasks-from-template for generating the linked issues?  I have looked through the script library and successfully used this one https://library.adaptavist.com/entity/automate-the-creation-of-an-issue-in-jira and thinking I could leverage https://library.adaptavist.com/entity/create-a-sub-task-when-the-parent-issue-has-a-specific-label as well.

 

Any guidance for scripting this more complex structure based on variable selections would be much appreciated.

  • Jira Software Data Center version:  8.16.1
  • ScriptRunner version:  6.36.0
  • Issue Templates version:  8.2.0

  

  • Epic
    • Story (If “Service 1” is selected from a multi-select variable in Issue Templates or Dynamic forms)
      • Task (if “Task 1” is selected Yes/No)
      • Task (if “Task 2” is selected Yes/No)
        • Sub-task (if “sub-task 1” is selected Yes/No)
        • Sub-task (if “sub-task 2” is selected Yes/No)
        • Sub-task (if “sub-task 3” is selected Yes/No)
        • Sub-task (if “sub-task 4” is selected Yes/No)
    • Story (If “Service 2” is selected from a multi-select variable in Issue Templates or Dynamic forms)
      • Similar hierarchy as above                                          

1 answer

0 votes
Fabian Lim
Community Champion
October 23, 2021

Hi @Laurie Sciutti

As long you can capture the values from the deviniti fields you should be ok. However,  you can end up with a lot of customfields. 

Now for agile theory, when you create an epic, you don't really know how many stories, subtasks are necessary, so not sure how someone will know at creation accurately. 

Regards 

Laurie Sciutti
Community Champion
October 25, 2021

Thank you for your response, @Fabian Lim.  Regarding the custom fields ~ this is what I'm trying to avoid.  Issue templates has Variable fields that act as prompts for user info but are not actual fields stored in the db.  The Dynamic Forms functionality in ScriptRunner seems to essentially be the same thing.  I'm looking to utilize either or both of these options in a Groovy script to auto-generate the issues from user input into those prompt "fields".  This is for onboarding new clients and since there could potentially be a 4-tier hierarchy, starting at the Epic issue type made the most sense.

Suggest an answer

Log in or Sign up to answer