I have ticket structure that has linked work items to it via the "relates to" link. I wrote an automation that fires from a manual trigger. It currently gets a list of items with that link type (it "should" only be 1), once finds that ticket I want to copy custom field data from my linked work item to the trigger ticket.
This is where I am having the problem. I have tried two methods.
1. Method 1
Create a variable during the "For" section and after that fill in the trigger ticket custom field with that variable. The problem I found is the data is either being lost/cleared from the variable or I cannot access it when I am back to the main automation.

Method 2:
Custom code in the "For" loop. With this I am having trouble updating the trigger issue and have not found great documentation other than "It acts like any issue".

Code:
{
"{{triggerIssue.fields}}":
{
"summary" : "{{issue.summary}}"
}
}