It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
tom lister Community Leader Nov 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
Answer accepted
Nic Brough Community Leader Nov 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)

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
Community showcase
Published in Jira

Managing Incidents - The roof is on FIRE!

The roof is on FIRE… network outages, broken processes, upset clients and employees. Each day seemed to bring more and more issues. Incidents were communicated via email, messengers (skype or teams) ...

122 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you