Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

fix versions field length always returns 1

Hasan Çavuşoğlu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2019

Hello,

I am trying to distinguish two different fix version types by comparing character length. 

for example fix versions value is 1.12.7.1

This statement returns true with value 1 regardless of the value of fix versions field

(issue.fixVersions.length == 1)

I would appreciate If you have any idea whats going on :) I want it to return false if the version character length is less then 8 characters.

 

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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 Champions.
July 24, 2019

Fix versions is not a string, it's a list of versions.  You're getting 1 back from .length when there's one item stored in it.

You'll need to work on the basis that the result is an array of options (even if there's only one item, which is not always the case - it supports multi-select), extract the name of each option in the list, and look at the length of those strings.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events