I created an automation in a project that is a manually triggered rule (for now).
In the automation, I do a lookup with the following query: "issue in linkedissues({{issue.key}}) and type = bug "
When I run the same query in ScriptRunner, I get 11 results for the target issue, so I believe this is correct:

In the automation, I then edit the issue using {{lookupissues.size}}. When I run to automation, the field is set to zero, and not the expected 11.
What am I doing wrong here?

I did try changing the edit value from "{{lookupIssues.size}}" to "={{lookupIssues.size}}" and then got the following error in the audit log:
Action details:
MANUAL TRIGGER
The user Matthew Noe triggered the rule
LOOKUP ISSUES
A search during custom value definition found no issues.
EDIT ISSUE
Could not convert the field value to a number. Please ensure the value is a number, math expression or smart-value that can be converted into a number.
No fields or field values to edit for issues (could be due to some field values not existing in a given project):