Forums

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

What's the smart value to retrieve a comment made on transition?

Callum Carlile _Automation Consultants_
Community Champion
July 9, 2020

I've got an Automation rule set up to send an email to the issue assignee upon a transition. On the transition screen, there's the comment field so the user has the option to add a comment.

Part of the custom message in the email is as follows:

See below for the comment added:
<hr>Comment Author: <b>{{initiator.displayName}}</b>
Comment: <b>{{issue.comments.last.body}}</b><hr>

Which looks like this in the email:

comment.PNG

However, because the comment on transition isn't mandatory, if no comment is added, the email will still display the LAST comment to be made on the issue (because of the {{issue.comments.last.body}} part).

Does anyone know of the smart value to ONLY pull the comment into the email IF it's added on the transition? (Basically, if no comment is added on the transition, I'd like this to be blank in the email)

1 answer

1 accepted

6 votes
Answer accepted
Callum Carlile _Automation Consultants_
Community Champion
July 9, 2020

Solved! FYI for anyone looking for a solution, I've set up the following rule. It's slightly complicated but works well.

On the transition, it checks the time difference between now and the time the last comment was posted (in this case, it checks if the last comment was posted within the last 10 seconds).

If it has, then it will send the first email template, containing the last comment smart value. If not, it will send the second email template which doesn't have a comment-related smart value.

email condition.PNG

John Funk
Community Champion
July 9, 2020

Hi Callum - This is an Excellent example of what you can do with Automation! Well Done!

@John McKiernan1 FYI

Like John McKiernan likes this
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2020

This is a great way to use automation - Kudos!

Hugo Gómez July 21, 2022

@Callum Carlile _Automation Consultants_I don't know how I've would have solved my problem without your answer!

I'm experimenting trying to create a new issue by transitioning an existing one but wanted to have the comment from the transition screen "moved over" to the newly created issue, instead of keeping it in the transitioned issue.  So, your sample was key for me.

Thank you! 👍🏻

Suggest an answer

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

Atlassian Community Events