Forums

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

isEmpty does not work for fixVerions , Verions

Xiaoli August 16, 2023

An issue that have empty fixverions , verions, but the smart value returns null with isNotEmpty or isEmpty function

the code used in the comments are:

issue.versions.isEmpty()={{issue.versions.isEmpty}}
issue.fixVersions.isEmpty()={{issue.fixVersions.isEmpty}}
issue.versions.isNotEmpty()={{issue.versions.isNotEmpty}}
issue.fixVersions.isNotEmpty()={{issue.fixVersions.isNotEmpty}}
exists(versions.name)={{exists(versions.name)}}
exists(fixVersions.name)={{exists(fixVersions.name)}}
exists(issue.latest.versions.name)={{exists(issue.latest.versions.name)}}
exists(issue.latest.fixVersions.name)={{exists(issue.latest.fixVersions.name)}}

 

the result returns:

issue.versions.isEmpty()=
issue.fixVersions.isEmpty()=
issue.versions.isNotEmpty()=
issue.fixVersions.isNotEmpty()=
exists(versions.name)=true
exists(fixVersions.name)=true
exists(issue.latest.versions.name)=true
exists(issue.latest.fixVersions.name)=true

 

why the issue do not have a fixversion or versions but the exists function returns True and isEmpty isNotEmpty does not work?

How could I check if this issue has no fixverions?

1 answer

1 accepted

0 votes
Answer accepted
Florian Bonniec
Community Champion
August 16, 2023

Hi

Maybe the field fixVersion is hidden in the field configuration, so for jira it do not exist it's neither empty nor not empty.

 

Regards

Xiaoli August 16, 2023

Thanks, but the exists returns true.

Florian Bonniec
Community Champion
August 17, 2023

What is your hosting solution. are you using Data Center or Cloud version of JIRA ?

Xiaoli August 17, 2023

Yeah, I assume it might be data center. 

https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html

I plan to use the equals(list.size,0) instead.  

Florian Bonniec
Community Champion
August 18, 2023

Hi

 

I have the same behaviour on my side.

Not sure is isEmpty fucntion is available in Data Center version. It's mentionned in the Cloud Doc but not the Data Center doc.

But in the conditional logic section of data center there is an example with this function.

Also I do not think issue.latest.versions.name is valid on Data Center.

 

Regards

Xiaoli August 29, 2023

Yes, you are right, so can only use list.size for versions, fixverions. 

Thanks a lot. 

Suggest an answer

Log in or Sign up to answer