Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jira-Python : Create versions for project
# replce server address with actual Jira host for your case
options = {'server': ''}
jira = JIRA(options, basic_auth=(os.environ['JIRA_USERNAME'], os.environ['JIRA_PASSWORD']))
#get currently available version names
project = jira.project('PROJECT-KEY')
versions = jira.project_versions(project)
current_versions = [ for v in reversed(versions)]
for number in range(0, 82):
vname = 'v' + str(number) + '.0.0'
# check in the existing version names
if vname in current_versions:
print(vname, ": exists")
# try to create new
version = jira.create_version(name=vname, project='PROJECT-KEY')
print(vname, ": created, all good")
print(vname, ": creation failed")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment