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}}"
}
}
Both of the methods you show use branches which could find more than one work item. Branches of that type process in parallel and asynchronously, and thus any variables created inside the branch vanish after each item is looped over...and, there is no guarantee the branch will complete before the steps you show afterwards.
For your scenario you describe updating the trigger work item; please try using the Lookup Work Items / Issues action instead of using branching:
For the link type in the JQL, please confirm that matches your needs by testing it with an example work item in a search.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.