What to put in JQL field for a scheduled automation

Alex Wood July 20, 2022

Hello,

I am new to Jira Work Management.  I'm trying to create an automation that will set priority of tasks based on due date.  I have set the automation to run once per day, but it appears that to enable such scheduled automation, I need to check the "Run a JQL search and execute actions for each issue in the query" box.  Once I do that, it pops up a required "JQL" field, but I am not sure what I am supposed to put into this field.  I tried inserting an account ID from the drop-down, but then when I test ran the automation, it gave me an error, so maybe something else was supposed to go into this box?

Thanks for any help you can provide!

Alex

1 answer

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2022

Hi @Alex Wood and welcome to the community!

Instead of using a scheduled trigger, you could use the Field Value Changed trigger so that every time an issue's Due Date field changes, it executes.

Alex Wood July 20, 2022

Thanks, Mark for the suggestion.  I'm not sure if your solution would work as I would want the priority auto-updated as a due date approaches?

Regardless, I did some more experimenting and I now realize that JQL field is for the initial search parameters that will run each time the automation is scheduled.  I had assumed that the if/else blocks would take care of this, but I guess you need a broad JQL search to kick off the process?

Anyhow, I put in "due <= 2w" in the JQL field and it seems to be happy with that.  (Even though this is basically repeated in the if/else blocks???)

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2022

Thanks for the additional context.  If you want to share a screenshot of your rule, we can help optimize it.  The query should only be required once at the trigger.  I would have something like this:

  • TRIGGER: duedate <= 2w AND resolved is not empty
  • IF CONDITION: Priority = High
    • ACTION: Do something
  • ELSE: Priority = Medium
    • ACTION: Do something else
Alex Wood July 20, 2022

The idea is to set priority to "highest" <1wk out, and "high" <2wk out.  I've created a label ("manual") to allow people to exempt projects from this automation.

 

automation.jpg

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2022

A minor tweak is that you could add this to your trigger query and remove from your conditions.  It'll perform a little better, but otherwise, your rule looks good.

AND status != Done

Like Alex Wood likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events