Forums

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

I need to get the version status that is in the field Fix Version.

Evgen Garbuz November 28, 2018

Hi to all i need some hellp

I need to get the version status that is in the field Fix Version.
On any language Jython Pythone JS

I'm not a programmer, but  I tried to do that: 

Status = issue.getFixVersions().getStatusObject().getName()
if Status == 'Unreleased':
  result = False
  description = "Comment"
else:
  result = True

And this is expectedly not working.
Help please.

3 answers

2 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 Leaders.
November 28, 2018

Once you've identified the version you want to look at from the list, you'll need to ask it about its release status.

getStatusObject is about issue status usually, versions don't have a status.  You'll want to check isArchived and isReleased (if neither is true, it's an active version)

0 votes
Answer accepted
Tom Lister
Community Champion
November 28, 2018

Hi @Evgen Garbuz

The getFixVersions() will return a collections

try something like

def fixV = issue.getFixVersions().toList()
fixV?.name.contains('blah')
0 votes
Evgen Garbuz December 3, 2018
Thank you very much to all who responded. I solved this problem by Jython Validator  :

from com.atlassian.jira import ComponentManager
from com.atlassian.jira.project.version import DefaultVersionManager

versionManager = ComponentManager.getComponentInstanceOfType(DefaultVersionManager)
result = True
for fixVersion in issue.getFixVersions():
       for releasedVersion in versionManager.getAllVersionsReleased(True):
              if fixVersion == releasedVersion:
                      result = False
                       description = "Comment"

Suggest an answer

Log in or Sign up to answer