ticket_abstractor_client 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ticket_abstractor_client/jira_client.rb +16 -10
- data/lib/ticket_abstractor_client/version.rb +1 -1
- data/lib/ticket_abstractor_client.rb +7 -6
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4249d525374259adfc4e34a5eda40940e121eee4
|
4
|
+
data.tar.gz: 2782077ca515847ae6564ba655395e66a0f03362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e5ab88771c8ed0a1c9ebfc808690be0b391d57d8a0dbfc1bac5edd23b2fbd7590e5b89afc6118a6d86de5f52aedbdb7b88111af2e45c7cfeb8a50739e4eb3f0
|
7
|
+
data.tar.gz: 753c831d8ffa3f67e18b58f5280f012b9a703422c1bb5a8dcbdf96f8c8a95badbd4806f19da6a00791be84015053d81bd475a8498cd3c311a7ec3831adb5fffa
|
@@ -1,4 +1,10 @@
|
|
1
1
|
class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
|
2
|
+
|
3
|
+
def initialize(base_url, security_token = nil, endpoint = 'tp')
|
4
|
+
super base_url, security_token
|
5
|
+
@jira_endpoint = endpoint
|
6
|
+
end
|
7
|
+
|
2
8
|
##
|
3
9
|
# Get jira issue by issue id
|
4
10
|
#
|
@@ -10,7 +16,7 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
|
|
10
16
|
# >> client.jira.get_issue 'IFS-123'
|
11
17
|
# => { 'id' => 'IFS-123', 'description' => '...', ... }
|
12
18
|
def get_issue(issue_key)
|
13
|
-
get "ticket/jira/#{issue_key}"
|
19
|
+
get "ticket/jira/#{issue_key}", jira_endpoint: @jira_endpoint
|
14
20
|
end
|
15
21
|
|
16
22
|
##
|
@@ -28,15 +34,15 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
|
|
28
34
|
end
|
29
35
|
|
30
36
|
def get_issues_by_query(query)
|
31
|
-
get
|
37
|
+
get "jira_v1/get_issues_by_query", query: query, jira_endpoint: @jira_endpoint
|
32
38
|
end
|
33
39
|
|
34
40
|
def get_users_by_query(query)
|
35
|
-
get 'jira_v1/get_users_by_query', query: query
|
41
|
+
get 'jira_v1/get_users_by_query', query: query, jira_endpoint: @jira_endpoint
|
36
42
|
end
|
37
43
|
|
38
44
|
def get_issues_statuses_by_search_query(issues_id)
|
39
|
-
get 'jira/get_issues_statuses_by_search_query', issues_id: issues_id
|
45
|
+
get 'jira/get_issues_statuses_by_search_query', issues_id: issues_id, jira_endpoint: @jira_endpoint
|
40
46
|
end
|
41
47
|
|
42
48
|
##
|
@@ -50,26 +56,26 @@ class TicketAbstractorClient::JiraClient < TicketAbstractorClient::Client
|
|
50
56
|
# >> client.jira.get_issues_by_filter 24320
|
51
57
|
# => [{ 'id' => 'ID-1', ... }, { 'id' => 'ID-2', ... }]
|
52
58
|
def get_issues_by_filter(filter_id)
|
53
|
-
get 'jira/get_issues_by_filter', filter_id: filter_id
|
59
|
+
get 'jira/get_issues_by_filter', filter_id: filter_id, jira_endpoint: @jira_endpoint
|
54
60
|
end
|
55
61
|
|
56
62
|
def get_fields_by_project(project_key)
|
57
|
-
get 'jira/get_fields_by_project', project_key: project_key
|
63
|
+
get 'jira/get_fields_by_project', project_key: project_key, jira_endpoint: @jira_endpoint
|
58
64
|
end
|
59
65
|
|
60
66
|
def create_issue(opts = {}, *attachments)
|
61
|
-
post('jira/create_issue', { opts: opts }, attachments: attachments)
|
67
|
+
post('jira/create_issue', { opts: opts, jira_endpoint: @jira_endpoint }, attachments: attachments)
|
62
68
|
end
|
63
69
|
|
64
70
|
def create_tvx_issue(opts = {})
|
65
|
-
post 'ticket/jira', opts
|
71
|
+
post 'ticket/jira', opts.merge(jira_endpoint: @jira_endpoint)
|
66
72
|
end
|
67
73
|
|
68
74
|
def update_issue(opts = {}, *attachments)
|
69
|
-
post(
|
75
|
+
post("jira/update_issue?jira_endpoint=#{@jira_endpoint}", { opts: opts }, attachments: attachments)
|
70
76
|
end
|
71
77
|
|
72
78
|
def add_comment(issue_key, comment)
|
73
|
-
post 'jira/add_comment', issue_key: issue_key, comment: comment
|
79
|
+
post 'jira/add_comment', issue_key: issue_key, comment: comment, jira_endpoint: @jira_endpoint
|
74
80
|
end
|
75
81
|
end
|
@@ -2,28 +2,29 @@ module TicketAbstractorClient
|
|
2
2
|
def self.initialize_client(url, security_token = nil)
|
3
3
|
@url = url
|
4
4
|
@security_token = security_token
|
5
|
-
@
|
5
|
+
@clients = {}
|
6
6
|
|
7
7
|
self
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.jira
|
11
|
-
@
|
10
|
+
def self.jira(endpoint = 'tp')
|
11
|
+
@clients["jira_#{endpoint}".to_sym] ||= JiraClient.new(@url, @security_token, CGI.escape(endpoint.to_s))
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.brouha
|
15
|
-
@
|
15
|
+
@clients[:brouha] ||= BrouhaClient.new(@url, @security_token)
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.itrc
|
19
|
-
@
|
19
|
+
@clients[:itrc] ||= ItrcClient.new(@url, @security_token)
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.ilogger
|
23
|
-
@
|
23
|
+
@clients[:ilogger] ||= ILoggerClient.new(@url, @security_token)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
require 'cgi'
|
27
28
|
require 'json'
|
28
29
|
require 'rest_client'
|
29
30
|
require 'ticket_abstractor_client/version'
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ticket_abstractor_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rsamoilov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rest-client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.6.7
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.6.7
|
55
55
|
description: Get access to Jira and Brouha ticketing systems through the single service
|
@@ -77,12 +77,12 @@ require_paths:
|
|
77
77
|
- lib
|
78
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.9.2
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|