Hi! I'm trying to set up an automation rule to leave a comment on Jira tickets when the time logged is over the original estimate for the ticket. Which I have been able to set up:
However, the problem is that this now leaves a comment every subsequent time that someone logs time against that Jira ticket. I only want this rule to run and post a comment once when the time goes over expected, not every single time work is logged on it afterwards. Is there a way to put a condition in to not run a rule if it's been run successfully before? Or a different way to trigger it?
Thanks
Hi @Shelby Rosten
Did you put the "Prevent duplicates by only adding this comment once to a particular work item." checkbox as ticked, like in the attached screenshot?
It checks the target issue. If the same comment text already exists, Jira skips adding it again. If the comment does not exist yet, it adds it normally.
There are two ways you can approach this:
1) Use a prefix in your comment such as [OVERAGE ALERT]:<Rest of Comment>. Modify your If condition to check both time tracking comparison, and jql below which returns records that don't have a comment with your prefix.
The issue with this approach is that the jql is too loose. You'll need to tighten it up with additional conditions so that it returns less recrords.
comment !~ "[OVERAGE ALERT]"
2) Instead of using the above, add both a check for a label and an action to add a label. Let's say you'll use 'BudgetAlert' label, so you need to add a check for Labels field and make sure it doesn't contain 'BudgetAlert', if it doesn't, you'll apply your comment AND apply 'BudgetAlert' label. Thus anything that has been labeled with this label will be ruled out by your condition check.
I prefer the second method as comment string searches will return large number of records, so that automation will be unnecessarily expensive
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.