Skip to content

Commit 9953549

Browse files
committed
feat(move) if no transition provided, list available ones
1 parent adb09f0 commit 9953549

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

jiraya

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,17 @@ def move(jra, args):
190190
print('No next status step.')
191191
return 0
192192

193-
if len(available_transitions) > 1 and transition is None:
193+
if transition is None:
194194
print('Available transitions:')
195195
for trans in available_transitions:
196196
print(' - "{}"'.format(trans['name']))
197197
return
198198

199-
if transition is None:
200-
next_transition = available_transitions[0]
201-
else:
202-
next_transition = [t for t in available_transitions if t['name'].lower() == transition.lower()]
203-
if len(next_transition) == 0:
204-
print('Status not found for: {}'.format(transition))
205-
return 1
206-
next_transition = next_transition[0]
199+
next_transition = [t for t in available_transitions if t['name'].lower() == transition.lower()]
200+
if len(next_transition) == 0:
201+
print('Status not found for: {}'.format(transition))
202+
return 1
203+
next_transition = next_transition[0]
207204

208205
jra.transition_issue(args['<issue>'], next_transition['id'])
209206
print('Issue moved to {}'.format(next_transition['name']))

0 commit comments

Comments
 (0)