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,463,706
Community Members
 
Community Events
176
Community Groups

Size of cascade list (select list - cascading)

Edited

 

Hi All,

I am using custom field (select list - cascading), for example values bellow:

Client1Environments (parent)
    Env1
    Env2
    Env3
    Env4

Client2nvironments (parent)
    Env1
    Env2

size of Client1Environments = 4

size of Client2Environments = 2

Problem: How can I get size of the parent? I tried to use {{Client1Environments.size}}, however it gave me nothing. If i use {{Client1Environments.child.value}} it will return me the selected value in ticket, which i can the use for further processing, however i need to get the number of how many Env is in the list.

Thank you for your help!!

1 answer

0 votes
Hana Kučerová Community Leader Jul 29, 2021

Hi @l.vosahlo ,

welcome to the Atlassian Community!

I don't think it's possible. Please, what are you trying to achieve? Why do you need this information?

first off all thank you for your answer!

For example lets assume that our parent is following (it is vary according to client):
Client1Environments (parent)
    Env1
    Env2
    Env3
    Env4

 

myVariable = size of parent (in this case 4)

myCurrentEnvironmentId = {{#increment}}{{issue.Increment}}{{/}} (velue will be automatically increase per each iteration, in this case we know we have to run it 4times)

 

IF {myVariable != myCurrentEnvironmentId} (Do something else then ussual)

Basically, we are tusing JIRA for automatick deployment and this task can help us to handle our target environment:-)

I hope it is clear, if not let me know I will try to make better description.

The "size" of any cascading select list field is either 0 or 1.  0 means it is empty, 1 when it is not.  A cascading select can only ever have one value in it (even though that value can be a key pair, it is still only one value).  Imagine a custom field that has country/city lists in it - you can't set it to UK/London, US/San Francisco and Spain/Barcelona at the same time, it can only ever have one value.

I think what you're looking for is the *administration* data that there are X/Y options available, which is not something you would use in an automation.

I think you might be using the wrong type of field for this.  Maybe it should be a multi-select?

@Nic Brough -Adaptavist- I definitelly agree that value can have only one value (when selecte) - just to let you know, I am able to extract this value {{IssueName.child.value}}.

However, I was hoping that i would be able to take a parent as my Array and then use some loop (like in other language - BUT I fully understand i am using JIRa for something different that should be used:-))

I am going ask you one more question. Lets say I would like to print in the log 2nd value in the Client1Environment (which is Env2) - When i use {{Client1Environment.child.Value.get(1)}} it will return nothing. is there any command i can use? 

I'm not sure where you're trying to do this, I wouldn't expect an automation/smart value to go into a log

yes, you are right I am using Jira Automation - smart Values - I will attach some images

right side of image showing the details of my Select List (cascading) - Parent is automatically pick according to project name.

I tried those and none of this working for me:

.first()
.last()
.get(n)

 

I was hoping that command {{HMSEnvironment.child.get(1)}} will make a lookup in to the list and return me for example HMS Harry - Env2, but my log is empty, when rule is tested.

image.png

Ok, you're still thinking of the cascading select as holding more than one value, which they do not.  They have three possible single values:

  • Empty
  • Primary + Secondary (empty)
  • Primary + Secondary (with a value)

You can get at the primary and secondary separately, even though it's still a single value.  Try

{{issue.fields.Cascade.value}}
{{issue.fields.Cascade.child.value}}
Like Hana Kučerová likes this

Ok, got it - will try to use different type! I think we can close this topic! :-)
Thank you for help!

Like Hana Kučerová likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events