Class: JiraCommand::Jira::Status
- Inherits:
-
Base
- Object
- Base
- JiraCommand::Jira::Status
show all
- Defined in:
- lib/jira_command/jira/status.rb
Constant Summary
collapse
- BASE_PATH =
'rest/api/2/status'.freeze
Instance Attribute Summary
Attributes inherited from Base
#config, #conn
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#list ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/jira_command/jira/status.rb', line 12
def list
res = @conn.get(BASE_PATH)
body = JSON.parse(res.body)
body.map { |item| { id: item['id'], name: item['untranslatedName'] } }
end
|
#transite(issue_key:, target_status_id:) ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/jira_command/jira/status.rb', line 20
def transite(issue_key:, target_status_id:)
request_url = "rest/api/2/issue/#{issue_key}/transitions"
@conn.post do |req|
req.url request_url
req.body = { transition: { id: target_status_id } }.to_json
end
end
|