Hi all!
Goal: send different Slack messages based on the age of qualifying "Last Comments"
Ex: I add a comment with the keyphrase "PLS_ESCALATE" to items. I want to receive different messages around the time that comment hits ages of 24h, 48h, and 72h, respectively -- if at that time it's indeed still the last comment.
My current design is to use a "scheduled" trigger running regularly, looking for items with a qualifying last comment, then bucketing them into age intervals to report differently.
I've got the first part working, but can't find a component+smartvalue pairing to do the second part. Is this a case for advanced branching? If/Else? It's hard to know, because I have no last-comment date analysis working anywhere yet -- not for "issue.last.comment.created" nor for Last Comment.created -- so I am going in circles.
Can anyone advise on how to judge the age of the last comments in JIRA Automation?
Edit: bummer: rubber-duck-debugging style, I see now that it's "comments" in the smartvalues, not "comment" 🤦‍♂️, so I may make some progress again, but any advice still appreciated
You seem to have the smart value expression's attributes out of order. Please try this to find the age of the last comment added in hours using the diff() function:
{{issue.comments.last.created.diff(now).hours}}
If that does not help, please post the following for more context:
* what type of project is this (e.g., company-managed, team-managed, JPD, etc.),
* an image of your complete automation rule in a single image,
* images of any relevant actions / conditions / branches,
* an image of the audit log details showing the rule execution, and
* explain what is not working as expected and why you believe that to be the case.
Kind regards,
Bill
Hi @Bill Sheboy, it's a company-managed JIRA cloud project
complete automation:
and the error log:
I'd like to report the issues whose last comment contains a given string and is between given ages in hours, but it doesn't seem to be reading the smartvalue in identifying them
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got there!
I was surprised that pre-pending "lookupissues" to the smartvalue in the smartvalue comparison component got me over, was a wild shot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When the scope is a single issue, use the {{issue.someField}} and when using Lookup Issues, it is that scope for the set of issues {{lookupIssues.someField}}
Please note well: if lookup results have multiple issues, that expression will be a list of values, not a single one. How many issues do you expect the lookup to return?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A handful at most, but if their ages are expressed as a sum, this approach is flawed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the lookup returns multiple issues, you may need to do this in pieces, or adjust the expression:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> When the scope is a single issue, use the {{issue.someField}} and when using Lookup Issues, it is that scope for the set of issues {{lookupIssues.someField}}
Hi @Bill Sheboy , what about when the scope is within a branch? Even though "VarLastComments.comments.last.created..." works in the If component shown here, it's not what the Slack message is looking for. Two options that didn't work shown
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For posterity, here's what's worked and where I am on this now.
I tried a number of approaches to segregate last comments by age, got farthest with a Smartvalues Condition, but remained dissatisfied because that SmartValues Condition didn't let me specify both an upper and a lower bound for a range of hours.
An inline #if does not seem to work here (thought maybe I could match on "True")
What did work was expressing the age in days, then matching on whole numbers with "equals" (chaining as many of these blocks of day-numerals as I need to capture), or using the "contains regex" field to match on the range of possible numeral results for a range of hours. Examples of each in image
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.