40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/zensana/commands/project.rb', line 40
def convert(project)
@asana_project = Zensana::Asana::Project.new(project)
say "\nThis will convert the following Asana project into ZenDesk:\n\n id: \#{@asana_project.id}\n name: \#{@asana_project.name}\n\nusing options \#{options}\n\n BANNER\n\n unless yes?(\"Do you wish to proceed?\", :yellow)\n say \"\\nNothing else for me to do, exiting...\\n\", :red\n exit\n end\n\n if options[:default_user]\n default_user = Zensana::Zendesk::User.new\n if default_user.find(options[:default_user])\n options[:default_user] = default_user\n else\n say \"\\nDefault user '\#{options[:default_user]}' does not exist in ZenDesk!\\n\", :red\n exit(1)\n end\n end\n\n # LIFO tags for recursive tagging\n #\n # `project_tag_list` holds the project tags\n # and also the tags for the current task and\n # its parent tasks which are all added to the ticket\n #\n # `section_tag_list` holds the tags for the last\n # section task which are also added to tickets\n #\n tags = [ 'imported' ]\n options[:global_tags].each do |t|\n tags << normalize(t)\n end\n project_tags = [] << tags\n section_tags = []\n\n @asana_project.task_list.each do |task|\n task_to_ticket task['id'], project_tags, section_tags\n end\n say \"\\n\\n ---> Finished!\\n\\n\", :green\nend\n"
|