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,554,392
Community Members
 
Community Events
184
Community Groups

How to get item's index in list by its name?

Hello community!

The problem I'm trying to solve is to figure out is a version in a project is archived.
The closest thing I came up with is

{{project.versions.get(6).archived}}

But I would like to access the property by its name, not by its index.

The only thing I can think of is to iterate throughout the versions and to find my version by myself. But there must be an easier way.

1 answer

1 accepted

0 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.
Apr 13, 2022

Hi @axone -- Welcome to the Atlassian Community!

Without seeing your complete rule, I believe the answer is "maybe".

If you are trying to find a specifically named issue (i.e. literal value) in the list, you could try filtering the smart value list on the name, and then access the archived attribute: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588

If instead you are trying to use a dynamic value for filtering, such as from an issue's field or created variable, filtering does not work.  Instead you would need to walk the list in an advanced branch and use conditional logic to test archived.

Kind regards,
Bill

Hi Bill.

The first method you suggested seems to be working for me. Thinks! That's the one I was hoping to avoid, though :D

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.
Apr 15, 2022

Now that I think about this...another way that might work is to expand your versions into a list with your own delimiters, iterate the list, use a regular expression with match() to find the desired name (which can use smart values as params), and then check the archived attribute.  Please note, I have not tried this.

Nah, this is also looks quite complicated )

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events