def test_01_createBundle(self): enum_bundle = EnumBundle() enum_bundle.name = "TestEnumBundle" enum_bundle.values = [] value_names = ["first", "second", "third"] for vn in value_names : element = EnumField() element.name = vn element.description = vn + " description" enum_bundle.values.append(element) response = self.con.createBundle(enum_bundle) self.assertTrue(response.find("http://unit-258.labs.intellij.net:8080/charisma/rest/admin/customfield/bundle/" + enum_bundle.name) != -1)
# import_result = target.importIssues(project_id, project_id + " assignees", tasks) # def agilezen2youtrack(source_url, source_token, target_url, target_login, target_password, project_names_to_import): source = Client(source_url, source_token) target = Connection(target_url, target_login, target_password) last_page = False current_page = 1 try: target.createCustomFieldDetailed("State", "state[1]", False, True, True, {"attachBundlePolicy": "2"}) except YouTrackException, e: print str(e) colors_bundle = EnumBundle() colors_bundle.name = "Colors" try: target.createBundle(colors_bundle) except YouTrackException, e: print str(e) try: target.createCustomFieldDetailed( "Color", "enum[1]", False, True, True, { "defaultBundle": colors_bundle.name, "attachBundlePolicy": "0" }) except YouTrackException, e: print str(e) try: status_bundle = StateBundle()