I am struggling with function which allow creating sub-task automatically after creation main task. I don't know why but all of those lines return null:
def issue = issue as MutableIssue
MutableIssue parent = issue.getParentObject() as MutableIssue
def parentIssue = issue.parentObject
def newSubTask = issueFactory.getIssue()
Issue issue = issue
I don't know how to get current issue and create subtask. This is my first experience with groovy and maybe somebody kindly help me with it. Thanks.
Hi @Adam Horba You can create a subtask automatically When you change the Issue
from Status to Another Status.
Steps:
1) Go to the Project WorkFlow Edit it.
2) Select the Particular Transition and Click on Post Function.
3) It will List the Postfunction list
4) Select the Scripted Postfunction and Add it and it will takes to you next window in that you have some options.
5) Select the Create Sub-task Option
a) Select the Sub-task issu type that you want to create automatically
b) if you want to copy the Field Values from Parent Issue
c) Update it
6) And Publish the Work Flow
Now When that Transition is Executed it will Create automatically a subtask
Please 1st test it in your Dev Environment and make changes in your Prod
I hope it helps
Thanks,
Kumar
Thank you @Kumar for answer but my issue is more complicated. I have to create about 20 sub-tasks depend on value from custom field. Each value from custom field has different set of sub-tasks. Generally this script is easy but I have no idea how to create single one. The rest of script i will manage on my own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.