Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automated notifications based on last customer response

wrabbit November 9, 2022

Hi there,

I've been trying to get a series of automation to work but have not succeeded. I had this working in Jira at a previous job, and it was perfect. Unfortunately, I set that up several years ago, didn't document how I did it, and I have been unable to recreate it. :-(

Here's how I need it to work:

  • If a customer hasn't commented on an issue for 3 days, an automated message will prompt them.
  • If a customer hasn't commented on an issue for 5 days (meaning two days after the 3-day warning), they will get a different automated message.
  • Finally, If a customer hasn't commented on an issue for 7 days (two days after the 5-day warning), they will get a final message, and the case will automatically close out.

Here's the current configuration. There are three automations, each scheduled to run every hour. Here are the queries for each one:

  • updated < -3d AND status = "Waiting for customer"
  • updated < -5d AND status = "Waiting for customer"
  • updated < -7d AND status = "Waiting for customer"

The 3-day notification works. The 5-day also works, but not until 5 days after the 3-day notification when I need it to be 2 days after the automated notification (the original 3 + 2 more days). The same is happening for the 7-day, of course.

So how do I get the 5 and 7-day automations to count based on the last customer comment instead of the previous automated comment?

Any help is appreciated!

3 answers

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2022

Hi @wrabbit - You'll need an advanced condition in your automation rule also using Updated can be a little messy.  Lastly, you can accomplish this with one rule. I would attack it like this:

  • TRIGGER: Scheduled (daily)
    I went with daily because it's probably overkill to execute every hour, but up to you to change it.  Do not use JQL here.  We'll cover that in the branches below.
  • BRANCH (JQL)
    This will look for all issues sitting in Waiting for Customer for 3-5 days
    • status = "Waiting for Customer" AND status changed BEFORE startOfDay(-3) AND status changed AFTER startOfDay(-5)
    • CONDITION (Advanced)
      • {{comment.comment.last.author}}
        Does Not Equal
        {{issue.reporter}}
    • ACTION: Send Email
  • BRANCH (JQL)
    Look for all issues sitting in Waiting for Customer 5-7 days
    • status = "Waiting for Customer" AND status changed BEFORE startOfDay(-5) AND status changed AFTER startOfDay(-7)
    • CONDITION (Advanced)
      • {{comment.comment.last.author}}
        Does Not Equal
        {{issue.reporter}}
    • ACTION: Send Email
  • BRANCH (JQL)
    Look for all issues sitting in Waiting for Customer 7+ days
    • status = "Waiting for Customer" AND status changed BEFORE startOfDay(-7)
    • CONDITION (Advanced)
      • {{comment.comment.last.author}}
        Does Not Equal
        {{issue.reporter}}
    • ACTION: Send Email

 

Give this a try and let me know if it works for you.

wrabbit November 10, 2022

Hey there! Thanks so much for the detailed reply. I tried implementing a version of this yesterday (screenshot attached) and scheduled it to run this morning. It posted the comments it should have. However, it "reset the timer," and the queries are validating against zero issues now. I think this is because the automation's comment on the issue is counted as the last comment.

So, it seems there needs to be some way to exclude the automated comments so that the queries are only based on the last customer comment. Is that something we can accomplish through the JQL?

 

Screen Shot 2022-11-10 at 10.49.17 AM.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2022

This is why I recommended tweaking the query and adding the advanced conditions.  Updated is too generalized and can cause challenges like this.

wrabbit November 10, 2022

If I understand your condition correctly, it was saying the last comment shouldn't be by the reporter. Is there a way to make it so that the last comment isn't by the Jira automation? That's the piece I can't figure out.

The status change you had recommended didn't work for me, by the way. That's why I went back to "updated" because it did work.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2022

So you're saying that even if the last comment was by the assignee, you'd want this rule to trigger?

If so, you'll need to get the ID of the Jira Automation.  The best way I can think of that is by creating a quick test automation like this:

  • TRIGGER: Manual
  • ACTION: Add Comment
  • ACTION: Re-fetch
  • ACTION: Log Action
    • {{issue.comment.last.author}}

This should get you the ID for the author and then you can update your advanced condition like this:

{{comment.comment.last.author}}
Does Not Equal
ID Retrieved from above

Are you getting an error with the query I provided or just not getting the right results?

wrabbit November 10, 2022

In terms of this automation, the last comment would always be by the assignee. That's the whole point. The assignee has asked the reporter/customer a question (more info, confirmation if the issue is resolved, etc.), but the customer hasn't replied. So this automation kicks in after 3 days of no response asking for an update to help prevent requests from stalling and staying unresolved. If the reporter still hasn't responded after 5 days total, send another reminder. And after 7 days total if there is still no response, close it out.

But if the customer does respond at any point during those 7 days, the status will change (it will no longer be in "waiting for customer"). When the assignee replies again, it would go back into "waiting for customer."

I hope that helps! I apologize if I did not explain this clearly before.

As for your query, it did not give the intended results. i.e., it was returning issues that had been updated within the last three days. The only way I could figure out how to get the intended results was with the queries in my screenshot (inspired by your suggestion). Now I just need to figure out how to get the automation to ignore it's own automated comments.

0 votes
Jon March 7, 2024

It is shocking that Jira doesnt have this feature by default, Zendesk makes this EXTREMELY easy.  Either way, I found a relatively simple single-rule solution.

The idea being that if a ticket is waiting for customer for 5 days we comment on it, and 2 more days later we close it.

 

  • When: Scheduled
    Every day at 9am
    JQL: status = "Waiting for Customer"
    # DO NOT only include issues that changed since the last time this ran
    •  If / else branch
      • If: all match
        • JQL:
          • updated < -2d
        • Smart values:
          • {{issue.comments.getFromEnd(0).body}} contains "this issue has been marked as stale"
        • smart values:
          • {{issue.comments.last.author.displayName}} equals Automation for Jira
      • Then: Comment on issue
        • "Hi [~accountid:{{issue.reporter.accountId}}], We havent heard from you for 7 days, so this issue has been closed.  Thanks.
      • And: transition to "Rejected"
    • else if:
      • Else-if: matches
        • JQL:
          • updated < -5d
      • Then: Add comment to issue
        • "Hi {~accountid:{{issue.reporter.accountId}}], We havent heard back from you for 5 days, so this issue has been marked as stale.  If the issue is not updated in 2 more days, it will be closed.  Thanks!
        • Prevent comment from being added more than once

 

This seems to be working for us.  The basic logic flow is:

  • Check for all issues in Waiting for customer.
    • If issue hasnt been updated in 2 days AND the most recent comment is the one we added lower in the rule that says the issue has been marked as stale AND the author is automation for jira, close the ticket.
    • Otherwise, if the issue hasnt been updated in 5 days, add a comment that says "Issue has been marked as stale..."

Its a relatively simple approach to the issue, and should work for as many warnings as you want, as long as you change the comment body of the warning, you can compare to just the comment you want with either {{issue.comments.getFromEnd(0)}} or {{issue.comments.last}}

 

Hope this helps someone!

 

0 votes
Wajdan Zahid February 12, 2024

Hi

You can check when the last comment was added too along with the comment author by using this smart value {{now.diff(issue.comments.last.created).abs.businessDays}} this will give you the difference value from today in number which you can compare with value like 5, 7

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events