I am trying to create an automation which checks to see if a status is unchanged after three days. If one of those three days was not a week day, it will ignore the ticket for that automation.
Right now my automation just runs on a schedule and pulls tickets that match this JQL value:
I know from here that there is a .dayofweekname property that can be pulled
https://support.atlassian.com/cloud-automation/docs/examples-of-using-smart-values-with-dates/
So I guess my ask is, Is there a way to a condition with logic like, "IF {{pastdays(3).dayOfWeekName}} CONTAINS regular expression (Sat|Sun) THEN ignore issue."
Is that something that can be done?
It looks like I may have been premature. Unfortunately this does not solve my problem. It seems like it is checking the value of *any* update in the past against the current time, not just status changes.
Hi, Jim.
Please take a look at the more advanced solution I noted earlier, where you use a custom field to track status changes with one rule and then use that value in your current one instead of Updated.
And if your workflow is very simple, such as ToDo, InProgress, and Done...there is a built-in field which can be used for this: statusCategoryChangedDate
Thanks,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah! Thanks for those resources. After testing with a manually triggered rule, I found the smart value I am looking for. For anyone else looking to do this, the logic is:
If
{{issue.statuscategorychangedate.toDate.diff(now).businessDays}}
is greater than 2
then
comment and close the ticket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please clarify your use case? Are you trying to report:
For either you may want to consider a date diff and business days to check the number of elapsed business days since a change: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
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.
Hi Bill,
Thank you for looking at my question. In this case, my question would apply to your second scenario. Any status would has not changed in at least 3 business days.
From what I can tell, however, getting a date diff does not include the names of the days of the week?
Thanks again,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jim,
When JQL does that search for the trigger, it is running against the issue history...and we do not have access to that in an automation rule (unless you call the REST API).
Let's consider the simplest way to solve this: comparing the updated date to now. If we assume the last issue update was to the status, then you may ignore the day of week names and just check business days diff using and advanced compare condition:
But what if the issue was updated for other reasons, such as adding a comment? For a more advanced solution, you would need a custom field to save the date/time whenever an issue transitions to a new status. You may do this with a second rule:
Now your scheduled trigger rule can perform the reporting by comparing the custom field to {{now}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Fortunately, in our environment, when a comment is added the status is automatically updated, so I think your first answer should be perfect!
Thank you so much. Side note, is there a resource I can refer to to get a list of all the smart values and how they can be used together?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! I am glad to learn that helped.
Here are some good sources for smart values, their usage, and example rules. I also recommend following the automation product group in the community to watch for updates and new features in the articles.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
https://www.atlassian.com/software/jira/automation-template-library#/
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
https://community.atlassian.com/t5/Atlassian-Automation/ct-p/automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah! Thanks for those resources. After testing with a manually triggered rule, I found the smart value I am looking for. For anyone else looking to do this, the logic is:
If
{{issue.statuscategorychangedate.toDate.diff(now).businessDays}}
is greater than 2
then
comment and close the ticket
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.