Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do we update the triggering issue in a FOR loop of linked tickets?

Howard Thompson June 30, 2025

The sequence is:

1 - When work item is updated

2 - For Linked Work Items (Blocks links)

3 - *** Need to assign the linked issue.summary to a custom field in the trigger issue

======================

This all boils down to:

TmpIssue = Triggering Issue;

TmpStr = "None";

For List of linked tickets {

  If desired ticket found then {

    TmpStr = linkedTicket.summary;

    break;

  }

}

Tmpissue.someCustomfield = TmpStr; // assigning the linked ticket summary

================================

But this kind of thing isn't supported?

https://jira.atlassian.com/browse/JIRAAUTOSERVER-985

What do you do instead? 

===============================

I have tried:

Creating variables but the scope issue from JIRAAUTOSERVER-985 means I always end up with "None"

If tried doing a JQL lookup for the original trigger issue and assigning the summary recorded in a variable but I seem to be stuck in the context of the "For list of linked tickets" rather than the result of the JQL lookup. 

=============================

Anyone have ideas?

1 answer

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Champion
June 30, 2025

Hello @Howard Thompson 

Welcome to the Atlassian community.

Are you anticipating finding multiple linked work items that meet your criteria or just one linked issue?

If you anticipate finding only one, what would you want to happen if you found more than one?

You could do something like this:

When work item updated
Lookup Issues:
JQL: issue in linkedWorkItems("{{triggerIssue.key}}", "blocks")
Advanced Compare:
First Value: {{lookupIssues.size|0}}
condition: equals
Second value: 1

Edit Work Item (this will edit the trigger work item)
Field to set: <your custom field>
Value: {{lookupIssues.first.summary}}

That works if you expect to find only 1 linked work item. If you find only 1, then it copies the Summary from the linked work item to your trigger work item. If it finds 0 or more than 1, then it does nothing.

Howard Thompson July 2, 2025

Screenshot 2025-07-02 at 1.48.30 PM.png

Howard Thompson July 2, 2025

The goal is the triggerissue varBlockedStoryName field being assigned the Blocking Issue Story name. Yes, for the sake of this example, lets assume there is only one but if multiples existed and the name was over written that would be fine. THE PROBLEM is that the triggerissue is not update, instead the block linked story ticket from the JQL is updated instead. So, in the "Edit work item fields", how can we set the triggerissue instead?

Howard Thompson July 2, 2025

Screenshot 2025-07-02 at 2.41.27 PM.png

Howard Thompson July 2, 2025

If you add a Create Variable (tmpStr), assign the linked blocking summary, then lookup the original trigger issue and finally try that Edit work items again only this time assiging the tmpStr to the issue.summary. Then it still doesn't work. Once again, "issue" references the block linked ticket from the original For JQL.

Howard Thompson July 2, 2025

Hmmm..... Screenshot 2025-07-02 at 2.59.24 PM.png

Trudy Claspill
Community Champion
July 2, 2025

Hello @Howard Thompson 

The problem is when you use a branch then the actions taken within that branch will be taken against the issues identified in the Branch component.

The example I provided does not use a branch. 

Screenshot 2025-07-02 at 12.09.15 PM.png

If you want to accommodate finding multiple linked issues, and overwrite the trigger issue summary with the Summary of the last linked issue, then you could use this:

Screenshot 2025-07-02 at 12.11.11 PM.png

Howard Thompson July 2, 2025

@Trudy Claspill Thank You! You have solved this problem. I have other problems but you have freed me on to my next one. 

Like Trudy Claspill likes this
Trudy Claspill
Community Champion
July 2, 2025

I'm glad I was able to help!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events