Class: Dude::ProjectManagement::Jira::MoveTaskToList

Inherits:
Object
  • Object
show all
Defined in:
lib/dude/project_management/jira/move_task_to_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, id:, list_name:) ⇒ MoveTaskToList

Returns a new instance of MoveTaskToList.



7
8
9
10
11
# File 'lib/dude/project_management/jira/move_task_to_list.rb', line 7

def initialize(client, id:, list_name:)
  @client = client
  @id = id
  @list_name = list_name
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
# File 'lib/dude/project_management/jira/move_task_to_list.rb', line 13

def call
  issue = client.Issue.find(id)
  available_transitions = client.Transition.all(issue: issue)
  transition_id = generate_transition_id(issue, available_transitions)
  transition = issue.transitions.build
  transition.save!(transition: { id: transition_id })
end