Has anyone successfully created a subtask on the Create transition and subsequently linked it to its parent issue automatically in the same transition with a script?
I'd really appreciate if you'd share how this can be done
I believe this can be done with the SR Create Subtask post function.
Since it is a sub task, it needs to have a parent, so if you were to add this post-function in te onCreate transaction, it would create the subtask that you are looking for.
This is the dialog that you need to fill, and it can be accessed in the add postfunction dialog in the workflow transaction editor.
If you have more questions do not hessitate to ask.
That's a good point - a sub-task is always part of its parent and displays as such. The fact it is a sub-task means there is a link to the parent.
Creating an issue link as well is redundant (although if you looked at the code, you'd see an invisible "system" issue link is already there)
I'm running into something similar. There is a brief moment in time after the sub-task is created when it technically isn't linked to the parent. I know this is happening because I have a script listener that burns down the remaining estimate of the parent when the sub-task is created (this keeps the overall remaining estimate accurate up the chain so we're not double-counting, as the Remaining Estimate of the parent includes the Remaining Estimates of its children when using Portfolio).
This functionality works properly at any level above sub-tasks (e.g. when I add an issue to an Epic) when issues are created, but I have to go back into the sub-task and update it in order for the functionality to work properly at this level. This is because the script listener is triggering off of Issue Created, Issue Updated, and Work Logged On Issue events.
Since the listener works properly when the issue is updated and works properly for other issue types, it seems like the subtask and parent aren't actually linked at the time that the Issue Created event fires. I've tried adding post functions that do nothing but sleep for a second or two, but this hasn't had an impact. I've also added a sleep to the beginning of the script listener.
So, does anyone have any idea of how to get the parent/sub-task link to happen more quickly? I've also tried creating a post function that transitions the subtask back to the same status and triggers an Issue Updated event, but this also didn't have an impact.
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs