Class: JiraCommand::Jira::Assign

Inherits:
Base
  • Object
show all
Defined in:
lib/jira_command/jira/assign.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #conn

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from JiraCommand::Jira::Base

Instance Method Details

#execute(issue_key:, assignee:) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/jira_command/jira/assign.rb', line 15

def execute(issue_key:, assignee:)
  request_url = "rest/api/3/issue/#{issue_key}/assignee"
  @conn.put do |req|
    req.url request_url
    req.body = { accountId: assignee }.to_json
  end
end

#unassigne(issue_key:) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/jira_command/jira/assign.rb', line 23

def unassigne(issue_key:)
  request_url = "rest/api/3/issue/#{issue_key}/assignee"
  @conn.put do |req|
    req.url request_url
    req.body = { accountId: -1 }.to_json
  end
end