On an template (to send an email when an issue aproaches the due date), the JQL query is repeated again inside a branch (the loop for each Assignee). It was already executed at the begining to return the desired issues...
Why?
Hi Luiz - Welcome to the Atlassian Community!
Can you share the rule that you have so far? And then what's wrong with the results?
The rule is from a template - When a task is close to the due date then send an remainder email (or something like that is the text on the templates available). The JSON exported to the rule is too big to post here (too noisy).
But the logic is:
When: Scheduled (every day at X o'clock)
Then: Create a variable (somevar)
And: Do a search, a JQL expression with the 'somevar'
For each: some smart value from the JQL resultset
Then: Do a search, a JQL expression with the 'somevar' (AGAIN!?)
And: Send an email with some smart value from the JQL resultset
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Luiz Eduardo Freitas Santos
Would you please post images of your complete rule and the audit log details showing the rule execution? Those may provide context for what is happening, as I suspect this is either a branching or a variable scope issue.
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.
It is not an issue (apart from the lexical repetition), it works, it is Jira Software's own template... I just want to know why the JQL is repeated inside the loop branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reason I asked to see an image of the rule is what you describe is not possible: nested branching in automation for Jira rules.
And so I believe we are not aligned on how you are describing the rule and my understanding of it. Seeing the rule will confirm that.
Without seeing your rule...
I hypothesize you are seeing one or more JQL conditions and instead describing them as iterations/branches. A JQL condition can perform tests on issues to decide if the rule can proceed but it cannot supply issues for later processing.
If you instead you are asking about re-creating a variable inside of a branch, there are two possible scenarios for this...
To learn more about branches, please look here: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/
To learn more about conditions, please look here: https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, I think we are not in the same page, I'm posting the image of the rule, you will see that the JQL query is repeated inside a 'for each' branch.
This is the query repeat: 'duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee = {{distinctAssignee}}'
I thank you for your time on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You see.. we are already inside a for each loop that iterates through each record for the result of the first JQL query "duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee != empty".
I'm new on Jira's automation and syntax, but I'm a developer... as such I consider executing such 'SQL' repetition inside a loop that already is iterating through the records as an error...
My point of view is: executing a query to retrieve all records where a field is not empty, then, executing a query for each previous record where that given field is equal to the value retrieved at that record item... that's just dumb.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that rule image.
You noted earlier getting this rule from a template, and I believe you are using this rule from the project's templates: When a task is new due --> send email reminder.
The two different calls to Lookup Issues with similar JQL have two different purposes, helping to send each assignee one email, with only their issues. I will explain each step of the rule to help...
How does that help?
There is a rule feature that should help with this scenario: smart value, list filtering. However it cannot take variable as a parameter, and so we need to call Lookup Issues twice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understand, I just think that it could have been done in a different manner, without the need to execute queries again (same ones in essence), don't know if Jira's query can agregate or group records.
Perhaps it makes the logic simpler beeing a template, as it should.
Thank you.
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.