Hello Community,
I'm trying to add one condition in automation, and my question is as follows:
How do I add a condition in automation that states, "if the last comment (which is the trigger) was added within 5 minutes of ticket creation"?
Could someone please help me with this?
Thanks,
Dev Radia.
I wonder if you could simply use a JQL condition - Created >= 5m and Created <= -5m
it's basically test to see if the issue was created in the last five minutes. You're already triggering on the comment being added so I don't think you need to test when the comment was added in this case.
With that said, we might be able to come up with a better solution if we just understood your use case more completely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are aiming to only resolve cases where specific text is added! Saying that my main action is "When commented," and we're seeing if that comment matches the text we want. However, we want to ensure that the case will be resolved only if the comment is added within 5 minutes of ticket creation.
As you suggested, even if we know the JQL, we cannot add it to automation! If you could please guide... where can we add?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Testing for Comment text aside, why can you not add the suggested condition to your rule. For example...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Radia Dev
Yes, and...to the suggestions from @Jack Brickey
Even during normal processing conditions, automation rules do not always trigger exactly when the event happens that triggered them. Indeed, this causes a variety of racetrack timing problems in rules. And so comparing to "now" may not be accurate for your scenario.
With the work item commented trigger, you have the {{comment}} smart value, and that has its created date / time. For other triggers, the {{issue.comments.last.created}} smart value is available. Either of those could be compared to the issue's created field using a date / time difference and the Smart Values Condition. For example:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct, @Bill Sheboy! Making sense! That worked for me!
@Jack Brickey I tried your solution as well, but in my case, it should be "created >= -5m", which worked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Radia Dev
in theory a condition like this should work, but you would need a custom field that stores the time when the last comment was added.
So you will 1st have to have an automation that stores this information based on when a comment is created.
Then you could have another rule that checks agains this field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, this could be a solution, but I wonder if we can do it directly.
Still, even if I create an automation to store the date and time in that field, how will we determine whether the last comment is 5 mintes from that field or not?
Thanks,
Dev Radia.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So then you can have a smart values condition.
{{now.diff(issue.new-custom-field).minutes}} less than 5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.