Below script may give you some idea, I haven't tried by myself so may require some minor changes
def projectManager = ComponentAccessor.getProjectManager()
def project = projectManager.getProjectObjByKey("KEY")
def versionManager = ComponentAccessor.getVersionManager()
versionManager.createVersion("Version Name", new Date(), new Date()+7, "New Version Description",project.id, null)
Back in April of last year one of the major product announcements from Opsgenie was the launch of the Incident investigation view which created a deep connection between Bitbucket and Opsgenie, empow...
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