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.

Evgen Garbuz Nov 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
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 [Adaptavist] 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)

0 votes
Evgen Garbuz Dec 03, 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

1,492 views 3 14
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