Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to generate tasks within an epic with Scriptrunner


I need help with how I create a Post-function for a project. I am trying to create a post-function that creates and clones an issue. What I want, is that when I create an Epic in the project, that a number of tasks should be generated within that Epic (without me having to create them manually).

What I've tried so far is to create the clone and link post-function, but changing the issue summary to another name, and it kind of worked. Only that instead of creating one task when I created an Epic, 245 identical tasks were created. I don't really want to clone the Epic, but generate tasks automatically, but I figured the clone and link post function could be used, doing a workaround just giving the issue a new issue summary... However then the 245 new issues were created... So, how do I do this in the easiest way? I am not a coder or super technical, but appreciate any help. Thank you!

1 answer

0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 21, 2019

Your task must be using the same workflow as the epic. 

So that the epic creation triggered the creation of a task, which triggered the creation of a task which...

So in your Condition, put == 'Epic'

 Target Issue Type: select Task

In additional issue actions, you have to link your tasks to the epic

def cf = customFieldManager.getCustomFieldObjects(issue).find { == 'Epic Link'}
issue.setCustomFieldValue(cf, sourceIssue.key )

 Leave issue Link Type/Direction empty

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events