Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Automation - Close tickets based on new and existing tickets

Hi All,

I am trying to create an automation for a certain scenario, but I am having trouble navigating the click and build style of rule creation. 

The scenario here is that we create tickets based on the contents of an email if sent to a specific alias. We also receive automated health check report emails to said alias. So what I am having trouble navigating is to create automation for the following scneario:

  1. Email comes in with Summary - "Report #0001 - Open" 
  2. Email comes in with Summary - "Report #0001 - Close" 
  3. Automatically close both tickets "Report #0001 - Open" and "Report #0001 - Close"

And another scenario, just in general, is to close a ticket based on the Summary itself if titled "Close this" when coming in. 

Also please let me know if that scenario is possible to automate in general,


1 answer

1 vote

Hello @Supakij Ngamwongpaiboon ,

Thanks for reaching out and I believe I came up with a method that will meet these criteria.

First, to verify if I understand the workflow correctly it will flow as follows:

  1. The initial issue is created with an email using an automatically generated summary matching the format:
    1. "Report #XXXX - Open"
  2. Actions are performed on the initial issue disconnected from the automation rules
  3. When ready to close out the issue a secondary issue is created via email with a summary matching the format:
    1. "Report #XXXX - Closed"
    2. Where XXXX is the matching report number to the initial issue with the Open flag
  4. When The secondary issue is created with the Closed tag in the summary no action is taken on the secondary issue other than triggering an automation rule to close out the initial issue with the Open Tag

If I read this correctly the following Rule should do the trick,  and for a reference point, I am using concepts from the following documentation:

The rule flows as follows noting I added in a few Optional sanity check via comments to verify successful and failed operations:

  • When: Issue Created
  • Then: Create Variable
    • Variable name: 
      • OriginSummary
    • Smart value:
      • {{issue.summary.left(12)}}
      • NOTE:  If the XXXX value goes beyond 4 numerical values the rule will need to be adjusted to compensate for the increased number format.  I lined these values up with the "Report #0001" - Open/Closed from your description
  • If: Matches
    • JQL condition:
      • summary ~ "{{OriginSummary}}" AND summary ~ "Closed"
    • Branch Rule: For JQL
      • Type of related issues:
        • JQL 
      • JQL:
        • summary ~ "{{OriginSummary}}" and summary ~ "Open"
        • Deselect the option for "Only include issues that have changed since the last time this rule executed"
      • Then: Link issue to:
        • This issue:
          • Causes
        • Issue:
          • Trigger Issue
      • AND: Transition the Issue to:
        • Destination Status:
          • Resolved (Example status) 
          • NOTE: Choose the desired resolution status per your workflow
    • Re-Fetch Issue data:
      • Verifies that the source issue data is indexed for follow up actions
    • Branch Rule: For Current Issue
      • OPTIONAL: Add Comment to issue
        • Comment
          • This Issue was automatically closed relating to the Linked issue
      • Then: Transition the issue to
        • Destination Status:
          • Resolved (Example status) 
          • NOTE: Choose the desired resolution status per your workflow
  • OPTIONAL: Else:
    • Then: Add Comment
      • Comment
        • The Automation Rule Failed on the "Else" operation please check the variable on the rule and the automation Audit log for errors, and manually close the issues as needed.
          The current Origin Summary variable used is: "{{OriginSummary}}"
        • Deselect the option for "Only include issues that have changed since the last time this rule executed"

Hope this helps out and is what you are looking for.  Let me know if you have any follow-up questions.


Hi @Earl McCutcheon ,

Thank you very much for your response, this was exactly what I was looking for. 

I am however running into an error in that it is not closing out the "Open" / "New"(first) ticket, while automation does close out the "Closed" / "Completed" (second) ticket successfully. 



Screenshot of the audit log of the error:



Here is how the rule is set up, please let me know if I have anything set up incorrectly that would be causing this issue.

  • The OriginSummary smart value is {{issue.summary.left(28)}}



Hello @Supakij Ngamwongpaiboon ,

Thanks for all the details, and this one was throwing me for a loop for a while there too, as it seemed to be working on my end without issue in my test, However I was testing with slightly different syntax so after I aligned the syntax formatting I found the issue.

The JQL does not like the brackets "[" and "]" unless you close off the search as exact text vs approximate text for the search syntax.

If you modify the two JQL searches to the following the rule should work with the formatting including the brackets:

summary ~ "\"{{OriginSummary}}\"" AND summary ~ "Completed"


summary ~ "\"{{OriginSummary}}\"" and summary ~ "New"


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

1,116 views 32 33
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you