Overview
When you create a release from another release (the 'subrelease') via Create Release Task, you can set the variables and releases using the following Jython script:
from sets import Set
subreleasesTaskGroup = taskApi.searchTasksByTitle("Subreleases", getCurrentPhase().title,
getCurrentRelease().id)[0]
for template_var in subreleasesTaskGroup.templateVariables:
if template_var.key == 'text':
template_var.value = 'blah'
elif template_var.key == 'text2':
template_var.value = 'blah2'
elif template_var.key == 'bool':
template_var.value = True
# tag update
tags="app1,hello"
subreleasesTaskGroup.setReleaseTags(Set(tags.split(',')))
taskApi.updateTask(subreleasesTaskGroup)
In the example above, the Jython script will create variables called text, text2, and bool, and release tags called app1 and hello in the subrelease.
Comments
Please sign in to leave a comment.