How to auto create sub tasks after an issue with custom fields selected.

Chris Rose January 22, 2013

Hi there.

I will have a workflow that I need help understanding.

I will have issues created where there is a custom field that has 5 selectable options. These determine which teams work on the fix. What I need is for the issue to generate individual sub tasks for those selected options.

I would also need these sub-tasks to be individually assignable to different individuals (they will be set to assignable user status).

I would then want it to so that once all Sub-Tasks are completed and closed, the original master issue then closes too.

I am very new to writing scripts and such, so if I could get a detailed step by step, I would be forever in your debt. Thank you for taking the time to read this!

6 answers

1 accepted

2 votes
Answer accepted
Bhushan Nagaraj
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, 2013

Chris,

Let us start with closing the parent issue when the subtask is closed.

1. Go to the workflow being used by your sub-task.

2. Click on the transition you would like to run this script (to close parent task if all subtasks are closed)

3. Then select Post-functions and choose to Add a new post-function

4. Select "Script post-function" and click "Next"

5. Select "Transition parent when all sub-tasks are closed"

6. Choose the status for the parent task and a resolution.

Let me know once you get this far.

Chris Rose January 23, 2013

I have completed the steps you have mentioned. Thank you. What's your next advice?

Chris Rose January 23, 2013

Would you recommend that I have a separate workflow for Sub-Tasks? Or is sharing one across all issues/tasks and sub-tasks acceptable?

Bhushan Nagaraj
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, 2013

I would have subtasks follow a separate workflow as subtasks workflows in my experience are usually simpler than the parent task.

Please vote up the above answer if it helped you.

Bhushan Nagaraj
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, 2013

Yes, for that I need more information to help you.

What are the options in your multi-select list? What values do you want to transfer to the sub-task? Can you give me as much info as possible?

Chris Rose January 23, 2013

OK, well then I'll make a new one for sure. For now though, just to learn the process I'll stick to what I have. I've upvoted the answer. The only thing I need to do now is learn how to create autogenerated subtasks, depending upon which boxes in my custom field are ticked in the initial issue report.

Chris Rose January 23, 2013

OK, my selections in the field are language names;

English

French

Italian

German

Spanish

I would need a sub-task per language that is ticked to be made within the issue. So if only 3 of them are ticked, only 3 sub-tasks appear etc. All values can transfer. If it's possible to have the Sub-Task name generate the original ID number of the parent issue into it's summary, then that would be even better, but it's not essential.

Is this enough info, or would you need anything else?

1 vote
Bhushan Nagaraj
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, 2013

Hi Chris,

You might want to write your own plugin for this requirement. Heading back home now but I might have a plugin I have written that might help you get started of. Can mail you the project if you give me your email id. You can expect a response by tomorrow as I am done for the day.

Cheers

Bhushan

Chris Rose January 23, 2013

christopher.rose@culturetranslate.com

Thanks for your assistance. It seems as though the parent issue isn't closing when I close the sub-tasks, but I'm sure that's an error on my side that I will look into.

Chris Rose January 24, 2013

Hi Bhusan. Did you have that plugin available at all?

Thanks

Bhushan Nagaraj
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 27, 2013

Hey Chris, will send it to you in a few hours.

Eliza Crawford July 14, 2017

Hi Bhushan - could you please send me this plugin as well?

1 vote
Bhushan Nagaraj
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, 2013

Hi Chris,

Most of your requirements are covered by the script runner plugin.

https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner

Take a look at it and let me know if you require additional info

Chris Rose January 23, 2013

Hi, I accidentally tagged it as Ondemand before, but it's not. My apologies.

I have installed the plugin, but I'm very new to this, and I'm not strong at scripts.

After I have downloaded it, what would I need to do to get these stages in place?

Thank you for your help, it is very appreciated!

Bhushan Nagaraj
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.
May 29, 2013

So you want to create a subtask based on the multiple options selected in a multi-select field in a post-function?

What are the options on the multi-select field and what sub-tasks would you be creating? This question is already filled with comments. It will be easier if you can create a new question with more detailed information as to what you are trying to achieve.

Govardan Krishna May 29, 2013

Hi Bhushan,

i have similar requirement, i have a multi select Field, where user can choose/tick one or more options from multi select field, now i need to create sub tasks for each option selected.

Could you please help me with the script?

Govardan Krishna May 29, 2013

Thanks for ur quick reply Bhushan, as you mentioned i have created a new question. Could you please help?

https://answers.atlassian.com/questions/175354/create-sub-tasks-based-multi-select-custom-field

0 votes
David Wu March 11, 2014

Hi,

Not sure if your request being resolved, if not go this link:https://marketplace.atlassian.com/plugins/org.swift.jira.cotit's create on transaction for jira plugin meet exactly your needs

david

0 votes
Chris Rose January 23, 2013

Hi Bhusan, I accidentally tagged this as ondemand. It's the installed version I'm working with.

0 votes
Bhushan Nagaraj
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 22, 2013

Suggest an answer

Log in or Sign up to answer