Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Chron Expression and Automation HELP!

Jenny Finneran April 25, 2024

I'm having some issues with an automation that uses chron logic.

My JQL query is as follows:

project = (my project)AND issuetype in (issue types my team uses) AND status = "In Progress" AND NOT status changed AFTER 3 days.

When I run it with the correct project name and issue types, it returns 3 values. So I know the query works.

However, I am unsure of the correct Chron Expression for what I'm trying to do.

- I want to the automation to check the jql query conditions every Tuesday-Friday at 17:00 hr.

- I then want it to move the items that have been stuck in in progress for 3 days, and add a label of "Stuck".

- I then want it to move those items to "Blocked" status.

For the chron logic, I think it should be something like: 0 0 17 ? * TUE-FRI

Can anyone help troubleshoot? (See automation below)

Jira Community Chron Question.png

 

1 answer

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Hi Jenny - Welcome to the Atlassian Community!

Your CRON looks correct. Is it not running at that time? Or what is the problem?

Jenny Finneran April 25, 2024

Exactly. It's not running at that time.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2024

Hi @Jenny Finneran 

Adding to John's ideas...

Would you please post an image of the audit log?

And, looking at your JQL in the trigger, is that correct?  It seems to be checking for "NOT status changed 2 minutes in the future" as the value is positive, not negative, relative to "now".

Kind regards,
Bill

Like John Funk likes this
Jenny Finneran April 26, 2024

jira- audit log.png

Jenny Finneran April 26, 2024

I had changed the log to 2 mins for testing purposes, rather than waiting till an item had been stuck in the same status for 3 days. 

@Bill Sheboy and @John Funk - are you thinking that the automation is correct and the chron expression is correct, but the query is wrong?

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2024

Thanks for that information, Jenny.

If you expand any of those "No Actions Performed" items with Show more, I hypothesize it will show in the details that no issues were found.

Three things to check for that:

  • In the trigger, is the option checked for "Only include issues that have changed since the last time this rule executed"?  For your scenario, I believe you want that box to be unchecked, correct?
  • If the options was already unchecked, please copy your JQL from the trigger and try to test it standalone with View All Issues, confirming it returns the issues you expected.
  • Finally, looking at the rule details at the top, is the rule actor still set to the default of "Automation for Jira" or is it another user?

 

Like Jenny Finneran likes this
Jenny Finneran April 26, 2024

@Bill Sheboy -

- you are correct. Upon expanding  "No Actions Performed" It says no related issues can be found.

- "Only include issues that have changed since the last time this rule executed"? is already unchecked.

- When I run a JQL filter query, it returns 2 items.

- the rule actor is set to "Automation for Jira"

I'm noticing that it doesn't seem to be running at the specified time, so is the chron logic wrong?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2024

Returning to your JQL statement for a moment, did you really want to check things that have not changed for the last 2 minutes?  Your original question stated 3 days.

 

Like Jenny Finneran likes this
Jenny Finneran April 26, 2024

@Bill Sheboy and @John Funk  I was using 2 minutes for testing the automation rather than waiting 3 days. But yes, 3 days will be the intended time period. If the issues have been stuck in that status for 3 days when the automation runs, I want it to move those issues to blocked, and add a stuck label.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2024

Thanks for confirming that, and...

When testing a rule like this, you may want to use a test project and set the scheduled trigger frequency faster.  That will confirm the trigger, JQL, and rule actions work as expected.  Once testing is done, the schedule may be updated before the rule is copied / updated to run in the "production" project.

 

Like Jenny Finneran likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2024

@Jenny Finneran  - You don't need the 2 minutes to test. Once you have updated the rule, you can click the 3 dots to the right and select Run rule. It will run the rule immediately. 

But also, before then, simply run the query in the Filters/Search area to make sure something shows up first. 

Screenshot.png

 

Like # people like this
Jenny Finneran April 29, 2024

Thank you both. I finally got it working. The chron logic was right. The details needed help.

I was able to use the run now option you showed me to get it to move the items I expected, so my expectation is that it will continue to run at the correct time going forward:

Tues through Fridays, at 17:00, on items that have been stagnant in "In Progress" for three days

Like # people like this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 29, 2024

Great! Glad that’s working for you now.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events