Not easy to do it at the moment…
You can vote for it here: Add "Step 1 Linked/Unlinked Entity" in scripts
There’s a workaround something like this: How to create a comment in a thread view with Step 1 Linked entity - #8 by Chr1sG
It looks at markdown template and not scripting, but I think the idea can be extended to this problem. I’ve never tried it though.
Indeed this is an annoying place where no-code automations are more powerful than scripting.