Need script,automatically 10 sub tasks has to create when only story creates in jira

Mahendar D December 14, 2019

Hi,

 

Pls help out to me.

 

Jira has to create 10 sub tasks when story issuetype created.

 

We one workflow and 10 issutypes.

 

But I want to create 10 subtasks under story automatically.

1 answer

0 votes
Zita Bagi
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.
December 14, 2019

Hi,

are you using Adaptivist ScriptRunner?

If yes, you can add a post function which automatically creates sub-tasks.

In order to do that, you have to be an admin. Go to Project Settings > Workflows > click on the workflow > Edit > choose the Create transition >  Post Functions > Add post functions > Script Post-Function [ScriptRunner] > Create a sub-task > you can add issue.issueType.name == 'Story' > and then add fill out the rest of the options you need.

If you need to create 10 sub-tasks at once, you can add 10 Post Functions like this.

Mahendar D December 14, 2019

I have 10 issuetypes out of this 4 issuetypes has to create 10 subtasks when user creates tickets by one of the 4 issuetypes.

 

Than I have to write 40 times its heavy load to workflow.

 

Instead of this if u share any script that will be easy and I can config to multiple projects.

Zita Bagi
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.
December 14, 2019

I personally don't have a script for that.

Here is a topic with a similar script:

https://community.atlassian.com/t5/Jira-questions/Using-scriptrunner-I-need-to-know-how-to-create-multiple/qaq-p/621773

This works if  you just need to create multiply sub-tasks with the same information, but if you have to create them with different information, you will have to customize them manually with the built-in feature.

If you have to do it manually as I described earlier, I'd recommend to do it once in the beginning, even if it takes long, then copy that workflow to different projects, and make small adjustments, if needed.

Suggest an answer

Log in or Sign up to answer