Hi, I'm trying to use smart values to return a list of subtasks for a given task that are of a certain status. I've tried 2 different approaches and still am unable to return any results.
Approach 1 (integer):
Approach 2 (string):
Hi @Andrew Stolcers -- Welcome to the Atlassian Community!
I do not believe that smart value, list filtering works with the Server/Data Center version of automation yet.
The only work-around I can think of would be to use JQL for your conditions with a branch, enabling the bulk-handling feature, and then use the {{issues}} smart value to handle them as a set. Using this approach allows adding multiple conditions to the JQL.
Kind regards,Bill
Hey Bill, thanks for the quick reply.
I can successfully create a filtered list by subtask assignee using the lines below. Is there a reason why this would work, but filtering by status wont?
Interesting that the filter worked, although that is good news!
Let's try your code with a more specific condition on the id for the status...rather than letting it assume the default attribute:
{{#issue.subtasks}} {{#if(status.id.eq(10001))}}{{key}} {{status}}{{/}}{{/}}
Oh man, that was it!! Success!! Thanks!
How would you add an 'and if' for another condition?
Thanks again.
You do that with the and() expression, like this:
{{#issue.subtasks}} {{#if(and(status.id.eq(10001),assignee.displayName.eq("1234")))}}{{key}} {{status}}{{/}}{{/}}
https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html
The logical and() and or() functions only accept two parameters, and so if you need more conditions they need to be nested, like this:
and(conditionA,and(conditionB,conditionC))
It looks like you're new here. Sign in or register to get started.