Forums

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

Automation: find linked issues with a label when a version releases

Louise Baker
Contributor
November 7, 2025

Hi there!
I am trying to create an automation based on when a version releases. For now, though, I'm basing it off of "scheduled" so I have more control over kicking it off. The goal:

  1. When a version is released, for all the tickets that have that version as the fix version
  2. Find all linked tickets.
  3. If those linked tickets have the label jira_escalated
  4. round them up, and send them in an email. 
    1. to be clear, I'm desiring to email out the tickets with jira_escalated
    2. the audit log step is just to track it down easier for me.

I tried a lookup, and then sending email, but I got 100 individual emails, when really I'm expecting 2 tickets. So something with the lookup was not right. And, I can't stress this enough, I do NOT want an email for every single ticket.

 

What can I do here?

Screenshot 2025-11-06 at 4.37.15 PM.png

2 answers

3 votes
Marc -Devoteam-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2025

Hi @Louise Baker 

Use a list code to sent all information in a single email.

Example: 

{{#lookupIssues}}
* {{key}} | {{summary}} | {{assignee.displayName}} | {{url}}
{{/}}

You will need a lookup.

Also see this KB as a guideline/example, automation-rule-to-send-single-email-for-all-issues-per-assignee-due-next 

NOTE, it might alos work by replacing #lookupIssues, with #issues

Louise Baker
Contributor
November 7, 2025

thanks!
I tried this, but:
- my lookup returned ENTIRELY too many tickets
- i received an email for every single lookedup issue.

So, assuming I had my lookup wrong, I can't figure out how to do the lookup. Since I'm doing this within a branch, I am having a hard time writing the JQL.

What I wrote, and this was BELOW the audit portion in my first image
Screenshot 2025-11-07 at 9.56.29 AM.png

What this returned was 100 issues in ISHELP w/ jira_escalated. It ignored the fact that this was within a FOR LINKED ISSUES branch, really. 

So, how can I write JQL to only find linked issues with the label jira_escalated, SO LONG AS the linked issues were in the fix version I'm releasing? That's where I'm losing it in the JQL.

I can troubleshoot the email part after.

Marc -Devoteam-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2025

HI @Louise Baker 

I think to get the right items, you would need to set the fixed version on the linked issues as well.

So you would need an automation that sets the fixed version, when released, on all linked issues from ther issues in the release version, or a new custom field to store this.

Then have a second rule that can be triggered by another rule and there find all issues with the released version name and the required label and then sent an email with the found issues

The option you want is not possible in a single rule.

Louise Baker
Contributor
November 7, 2025

Hmm. I see. We have a policy at our company that we do not attach a fix version to something that it itself was not worked on / fixed, so this might not be a possibility for us.

I'll try to think of something else.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2025

Hi @Louise Baker 

Yes, and...to the suggestions from @Marc -Devoteam- to use the Lookup Work Items action to gather the items for one email...

Because you want to first get the work items with the specific Fix Version value, and then gather those items linked ones, filtering them by their labels, this would require two uses of the lookup action and some careful JQL:

  • trigger: Version Released
  • action: Lookup Work Items, with JQL to find the work items with the trigger's Fix Version value
  • smart values condition: confirm the lookup returned items
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • action: Lookup Work Items , using the results of the first lookup...
    • create a dynamic JQL expression to get those items, testing they are in the Fix Version
    • adding to that JQL, another dynamic JQL with an OR clause, expanding the linked work item keys from first lookup's items, adding a clause to check for the label you wanted
  • smart values condition: confirm the lookup returned items
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • action: send email, as now the lookup will have all the relevant items

 

I recommend first writing the relevant JQL expressions and testing them outside of the rule with example Fix Version values.  Once they work as expected, substitute in the smart values for use in the lookup actions.

 

Kind regards,
Bill

Like Louise Baker likes this
Louise Baker
Contributor
November 7, 2025

thank you. i followed you until the second lookup.
ignoring that I'm using fixVersion wrong, just a placeholder,

let's say the first JQL is:

project="IS" and fixVersion={{fixVersion}} and issueLinkType IS NOT EMPTY

return all tickets in this fix version that have a linked issue

My second JQL string would be something like:

linkedIssue IN ({{lookupIssues}}) and label = jira_escalated

Is that what you mean? If not, I am not entirely quite sure what to do here. I'm sorry!

I tried what I wrote here, and getting the error of "A search during custom value definition found no work items." in the second lookup step

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2025

Yes, that looks correct for your first JQL.  You may want to further limit by issue type and status, as needed.

 

For the second lookup's JQL, let's add a helper variable first to contain all of the linked issues for the ones in the first lookup.

  • action: create variable
    • variable name: varLinkedKeys
    • smart value:
{{#debug}}{{lookupIssues.issuelinks.inwardIssue.key.flatten.join(",").concat(",").concat(lookupIssues.issuelinks.outwardIssue.key.flatten.join(",")).split(",").match("^(..*)").distinct.join(", ")}}{{/}}

That looks a bit messy, and what it does is:

  • for the first lookup result, gather the issue links
  • getting the inward issue keys
  • flattening the nested lists into one
  • before joining that into a string
  • and concatenating on the same thing for the outward links
  • then split back into a list to remove any empty ones and duplicates
  • finally joining into a single string
  • wrapped inside of a {{#debug}} ... {{/}} so it can be seen in the audit log

That variable could be used in this JQL:

project = "IS"
AND (
(
key IN ( {{lookupIssues.key.join(", ")}} )
)
OR
(
key IN ( {{varLinkedKeys}} )
AND issueType IN ( your desired types )
AND labels IN ( jira_escalated )
)
)

This would gather all the work items from the first lookup, plus their linked issues meeting your criteria of having that specific label.  I added a clause for testing the issue types again for you to fill in.

I recommend testing that with some example versions / work items before updating anything.

 

Like Louise Baker likes this
Louise Baker
Contributor
November 7, 2025

Bill, you are truly amazing. This is not the first time you've helped me out, and when I was searching the heck out of this on these forums, I saw you present on nearly every answer, providing insightful and detailed information.

 

Thank you immensely. Truly.

 

"Rising Star" - more the the star! I always am grateful when I see your name pop up in a thread I post / follow :)

 

Like Bill Sheboy likes this
0 votes
Tudor Tofan
Contributor
November 7, 2025

Hi @Louise Baker 

To achieve this, you will need to use the "Lookup Issues" action: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

Screenshot 2025-11-07 184428.png

Louise Baker
Contributor
November 7, 2025

Thank you Tudor!

I did attempt a lookup, if you'll see in my original post, but it ignored the very critical piece where I want to find issues that are LINKED TO issues in the fix version. So, either wrong JQL (likely), or something else

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