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.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
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