Hi All,
We have a custom field set-up for status updates, where we are asking project leads to provide an update on epics once a fortnight (or when a significant update occurs). Our CTO has asked that when the status update field is updated, it is automatically posted as a comment.
While this is a fairly easy automation, i would prefer to add in a time delay of say 5mins. Reason being is that if someone is writing their update, submits it and then realizes they need to make a small change (maybe add a sentence, fix a typo etc.). The 5min delay (grace period) basically just stops multiple almost identical comments being posted.
The expected end result is that the epic has a bunch of historically dated comments which are status updates and can be read similar to a twitter (X) feed. I am well aware that activity feed with filter set to all would show this but it can be very noisy with all the other updates going on.
Atlassian as of a few days ago have rolled out a delay functionality up to 15mins. I'm yet to play with this and verify its behaviour but the concept looks promising. Pinning this as the answer for now and will report back with results once i have tested.
https://community.atlassian.com/t5/Jira-Service-Management-articles/Automation-delay-action-new-3rd-party-connector-updates-are-now/ba-p/2756730#M4836
I use the Scheduled trigger and run a daily task (or as often as needed). So using a Basic Scheduled trigger, I set the start date and time to the when i want it to become active, for example the time I created the trigger, then I set the occurrence to run as often as needed, for example every 1 day at 8:00am.
The key aspect is to use a JQL search such as 'status = "24 Hour Hold" and updated < -1d'.
In theory, this should check all tickets in the 24 Hour Hold status each morning and if they have not been updated in 24 hours, it will transition them to our 'reopened' status which is our 'then' in the rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Cory Hoover! This is a really creative solution and one i hadn't thought of before. There used to be some limitations around the number/frequency of scheduled automations but they seem to be relaxed (or im just imagining it).
As of a few days ago atlassian have added a delay functionality (up to 15mins) as per this request ticket. I've pinned my answer above with a bit more info, I intend to report back once I've had a bit of a play with it and share my findings. More info here:
https://community.atlassian.com/t5/Jira-Service-Management-articles/Automation-delay-action-new-3rd-party-connector-updates-are-now/ba-p/2756730#M4836
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dylan Moore
I’ve linked your suggestion to a related feature request, which counts as an upvote for this ticket:
https://jira.atlassian.com/browse/AUTO-238
If you’d like to chat to the Automation team, we’re always happy to learn more about how you’re using Automation and how we can improve - feel free to book a time that suits: https://calendly.com/cgavey/automation-feedback
Cheers,
Charlie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
pitty that today there are random delays everywhere;/
https://jira-service-management.status.atlassian.com/
i just hope all automations are executed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OUCH!
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.
So there's a hack that I've used before, making a web request to an external website:
https://hub.dummyapis.com/delay?seconds=3
(It turns out I was not the first person to come up with this workaround: AUTO-238)
The caution is that there is a 5 minute maximum execution time for automation rules:
So maybe you can do 4 minutes to be safe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Darryl Lee ! Do you know if theres another trigger of the same rule on the same ticket within the 4mins, will it essentially kill the original trigger?
I.e. - I update status update field, then 2mins later come back and edit a sentence. Will i still end up with 2x comments being posted each after the 4min delay or only the later comment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doh. You're absolutely right. It'll send two messages.
I THINK maybe you need to do another check to see if there have been more than one changes to the Status Update field in the last 4 minutes, and if so then do NOT add a comment. I wonder if this is possible by hitting the issue history API... I'm typing on my phone. Will check in a bit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I looked at the changelog API endpoint and I think it might have what we'd need.
When 4 min is up, you'd need to do a web request to:
https://YOURSITE.atlassian.net/rest/api/3/issue/{issueIdOrKey}/changelog?maxResults=100
(You will want to tune that # to balance the max number of changes to a ticket vs load time for the API call. I wish the changes were in reverse chronological order so we didn't have to grab so many.)
And using Advanced branching I then iterate through each changed item, like so:
So we need to check if there was a change to the Status Update field and if it was within the last 4 minutes. I guess after the 4 min delay, the next step should be to note that time:
Smart value variable: {{FourMinAgo}} = {{now.minusMinutes(4)}}
THEN, using Advanced compare condition we can check if it is the particular field:
{{change.items.first.field}}: Your Field Name
AND we can also compare the timestamp, but here's where I'm running into problems. I came up with this Smart value:
{{FourMinAgo.toDate.isBefore(change.created.toDate.convertToTimeZone("UTC"))}}
When I test this and look at the Audit logs, I'm seeing it switch to true, but I can't seem to get the comparison to work for booleans.
AND ANOTHER problem is that even if I got it to work, there's no "exit()" action to call, and I tried setting a {{nogo}} variable to 1 within the iteration, that does NOT seem to be globally accessible. (And I even added another 15-second delay to allow it to get "set".)
I'm sure there's some way to flip this logic, but that kind of thing always hurts my head. I'm sending out the Bat-Signal to @Bill Sheboy to see if he has any ideas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dylan Moore and @Darryl Lee
If I am understanding your scenario, what you are trying to do is create a running project work activity report log, using automation rules as follows:
The above described solution approach can create a race-track problem. A few alternatives are listed below:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.