I want to send a custom e-mail when issues transition to a specific status.
During this transition, there is an issue screen, so the user can leave a comment during this transition.
In case there is a comment, it should be included in the e-mail.
So far it's quite easy with Jira Automation:
Works like a charm. But: in case the user leaves no comment during the transition, the above automation will just use the latest comment on the issue in the mail body.
But in this case, no comment should be included in the e-mail!
How do I implement this?
PS: Here is the documentation about using comments as smart values. It did not help me.
Developer from Automation here.
Unfortunately we don't receive an event containing both the issue transition and comment together, so we cannot provide a reliable smart value that would indicate that comment came from that transition screen.
You would have to use last comment like you have, potentially you could also check the created date was within a certain timeframe like another user suggested, but there's no guarantee on ordering if that issue comment would have gone through. Adding a "Re-fetch issue data" just before checking last comment might help with that, which might be good enough for your use-case.
Apologies for the inconvenience.
I have just tested the following automation rule and I think it would meet your need:
In the "if" block, you send an email with the latest comment, and in the "else" one you don't.
Let me know if this helps!
Hi all, After many months of work, I am delighted to announce the launch of the Jira Automation Template Library! The Template Library is a new website dedicated to all things Jira au...
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