Class: Dude::ProjectManagement::Trello::MoveTaskToList

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MoveTaskToList.



9
10
11
12
13
# File 'lib/dude/project_management/trello/move_task_to_list.rb', line 9

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

Instance Method Details

#callObject



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

def call
  response = client.get("/1/boards/#{Dude::SETTINGS.dig(:jira, :board_id)}/cards/#{id}", { fields: 'id' })
  card_id = JSON.parse(response.body)['id']
  client.put("/1/cards/#{card_id}", { idList: list_id })
end