def getEnumBundle(self, name): return youtrack.EnumBundle(self._get("/admin/customfield/bundle/" + urlquote(name)), self)
def createEnumBundleDetailed(self, name, values): xml = '<enumeration name=\"' + name.encode('utf-8') + '\">' xml += ' '.join('<value>' + v + '</value>' for v in values) xml += '</enumeration>' return self._reqXml('PUT', '/admin/customfield/bundle', body=xml.encode('utf8'), ignoreStatus=400) def addValueToEnumBundle(self, name, value): return self.addValueToBundle(self.getEnumBundle(name), value) def addValuesToEnumBundle(self, name, values): return ", ".join(self.addValueToEnumBundle(name, value) for value in values) bundle_paths = { "enum": "bundle", "build": "buildBundle", "ownedField": "ownedFieldBundle", "state": "stateBundle", "version": "versionBundle", "user": "******" } bundle_types = { "enum": lambda xml, yt: youtrack.EnumBundle(xml, yt), "build": lambda xml, yt: youtrack.BuildBundle(xml, yt), "ownedField": lambda xml, yt: youtrack.OwnedFieldBundle(xml, yt), "state": lambda xml, yt: youtrack.StateBundle(xml, yt), "version": lambda xml, yt: youtrack.VersionBundle(xml, yt), "user": lambda xml, yt: youtrack.UserBundle(xml, yt) }