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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,722
Community Members
 
Community Events
184
Community Groups

If Equals smart values not working for issue status

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):

{{#issue.subtasks}}
  {{ #if(status.eq(10001))}}
    {{key}} {{status}} 1
  {{ /}}
{{/}}

Approach 2 (string):

{{#issue.subtasks}}
  {{#if(status.equals("10001"))}}
    {{key}} {{status}} 1
  {{/}}
{{/}}
Neither of the above return any results in the results log. However, when I have it return status with no conditional, it confirms there are multiple subtasks of status '10001'. I've also tried adding spaces for {{ #if}} and {{ /}}. This returns the full list of subtasks without properly applying the conditional.
Second question, what would I do if I wanted to add a second conditional? Only show subtasks of status '10001' and assignee with display name '1234'?
Thanks in advance!

1 answer

1 accepted

2 votes
Answer accepted
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.
May 15, 2023

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?

{{#issue.subtasks}}
  {{#if(equals(assignee.displayname, isempty))}}
    {{key}} {{status}}
  {{/}}
{{/}}
Taking one step back, my ultimate goal is to send a recurring email with the following.
For all issues with status 'X', send email to the requester with a list of subtasks if they are status 'Y'. I've tried playing around with the branches previously, but I don't think I'm able to call in the issue requester if i drill down to subtasks in a branch?
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.
May 15, 2023

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}}{{/}}
{{/}}
Like Andrew Stolcers likes this

Oh man, that was it!! Success!! Thanks!

How would you add an 'and if' for another condition?

Thanks again.

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.
May 16, 2023

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))
Like Andrew Stolcers likes this

Awesome - thanks again for the tips!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer