7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/jura/component/issue/change_column.rb', line 7
def self.render(issue)
prompt = TTY::Prompt.new
transitions = Api::Transitions.all(issue['id'])
status = prompt.select("Choose the status") do ||
transitions.each do |t|
.choice t['name'], t
end
.choice 'Cancel', 'cancel'
end
if status == 'cancel'
Sprint::Active.(prompt, issue)
return
end
unless prompt.yes?("Do you want to change the status of this issue to '#{status['name']}'?")
render(issue)
end
Spinner.render(
"Changed status of this issue from #{issue['fields']['status']['name']} to #{status['name']}!", clear: false
) do
Api::Transitions.transition(issue['id'], { transition: { id: status['id'] } })
end
puts ""
end
|