Discover the change management practices that are ripe for optimization
DevOps
Change has become the most important part of modern digital product cr ...
Read MoreThis post is from the XebiaLabs blog and has not been updated since the original publish date.
For all of those working with XL Release, you must be familiar with Gate Task. You can provide conditions in a Gate Task which have to be all checked before you can actually complete the task. What if you could use those to programmatically check which conditions are met? One caveat here of course would be to skip the task in case you don't want to check all conditions. Here's how it works
def gatesBeforeTask(task): gatesList = [] for item in phase.tasks: if str(item.getTaskType()) == "xlrelease.GateTask": gatesList.append(item) if item.id == task.id: break return gatesList gates = gatesBeforeTask(task) conditions = gates[0].getConditions() for condition in conditions: print "Condition: " + str(condition.title) + " is : " + str(condition.isChecked()) + "\n"
def gatesBeforeTask(task): gatesList = [] for item in phase.tasks: if str(item.getTaskType()) == "xlrelease.GateTask": gatesList.append(item) if item.id == task.id: break return gatesList gates = gatesBeforeTask(task) conditions = gates[0].getConditions() for condition in conditions: if condition.title == "gate2" and condition.isChecked(): result = False