zendesk-tools 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/zendesk-tools/clean_suspended.rb +4 -2
- data/lib/zendesk-tools/recover_suspended.rb +4 -11
- data/lib/zendesk-tools/version.rb +1 -1
- data/zendesk-tools.gemspec +1 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 160cc39c33f9f3ebbb6a73e8d333560accbb7170
|
4
|
+
data.tar.gz: 5e344b90daafb2819a84a8409991afa7fb978e9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b685220bdfb36c0314c9eb253879c5ea9f77f270d27a2f06d36c8c0ba8cd5830671b163927b3a19236a313b67ed6cf5ec75bd00b0bc4d9e993625597e95cc147
|
7
|
+
data.tar.gz: 3ed64d4dfc7b085aeb5d931ae994a27ac3ca20711666f1ce76c88498c0111d930931902ceb40aef78bf1e998268abf1175c91b9920eb7a866e0b91395c0d66ef
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Tools to automate common tasks in ZenDesk.
|
|
6
6
|
|
7
7
|
Install the gem:
|
8
8
|
|
9
|
-
$ gem install zendesk-tools
|
9
|
+
$ gem install zendesk-tools
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
@@ -17,6 +17,12 @@ Add a JSON config to ~/.zendesk-tools.json (TODO: make command line ovveride):
|
|
17
17
|
// mandatory
|
18
18
|
"username": "user@example.com",
|
19
19
|
"token": "your_token_here",
|
20
|
+
"url": "https://your_domain.zendesk.com/api/v2"
|
21
|
+
|
22
|
+
//include at least one cause
|
23
|
+
"delete_causes": ["cause1", "cause2"],
|
24
|
+
"delete_subjects": ["subject1", "subject2"],
|
25
|
+
"recover_causes": ["cause1", "cause2"],
|
20
26
|
|
21
27
|
// optional
|
22
28
|
"log_level": "debug",
|
@@ -32,4 +38,6 @@ Upload files to ticket:
|
|
32
38
|
|
33
39
|
$ zendesk-tools upload-files-to-ticket <ticket_id> <files>
|
34
40
|
|
41
|
+
Recover suspended tickets:
|
35
42
|
|
43
|
+
$ zendesk-tools recover-suspended
|
@@ -2,13 +2,15 @@ module ZendeskTools
|
|
2
2
|
class CleanSuspended < Command
|
3
3
|
include Loggable
|
4
4
|
|
5
|
-
|
5
|
+
# Array with delete causes. Defined in config file
|
6
|
+
DELETE_CAUSES = ZendeskTools.config['delete_causes'] || [
|
6
7
|
"Detected email as being from a system user",
|
7
8
|
"Detected as mail loop",
|
8
9
|
"Automated response mail"
|
9
10
|
]
|
10
11
|
|
11
|
-
|
12
|
+
# Array with delete subjects. Defined in config file
|
13
|
+
DELETE_SUBJECTS = ZendeskTools.config['delete_subjects'] || [
|
12
14
|
"Returned mail: see transcript",
|
13
15
|
"Delivery Status Notification (Failure)",
|
14
16
|
"Undeliverable:",
|
@@ -6,7 +6,8 @@ module ZendeskTools
|
|
6
6
|
class RecoverSuspended < Command
|
7
7
|
include Loggable
|
8
8
|
|
9
|
-
|
9
|
+
# Array with recover causes. Defined in config file
|
10
|
+
RECOVER_CAUSES = ZendeskTools.config['recover_causes'] || [
|
10
11
|
"End-user only allowed to update their own tickets"
|
11
12
|
]
|
12
13
|
|
@@ -19,23 +20,16 @@ module ZendeskTools
|
|
19
20
|
@client.suspended_tickets.each do |suspended_ticket|
|
20
21
|
if should_recover?(suspended_ticket)
|
21
22
|
log.info "Recovering: #{suspended_ticket.subject}"
|
22
|
-
# Logic for recovering the tickets
|
23
|
-
# Need to add logic for:
|
24
|
-
# * Grab ticket_id
|
25
|
-
ticket_id = suspended_ticket.ticket_id
|
26
23
|
|
27
|
-
|
24
|
+
ticket_id = suspended_ticket.ticket_id
|
28
25
|
author_id = suspended_ticket.author.id
|
29
|
-
|
30
|
-
# * Grab content
|
31
26
|
content = suspended_ticket.content
|
32
27
|
|
33
28
|
# * Create new comment with correct author and content
|
34
29
|
ticket = @client.tickets.find(:id => ticket_id)
|
35
30
|
ticket.comment = ZendeskAPI::Ticket::Comment.new(@client, :value => content, :author_id => author_id)
|
36
31
|
|
37
|
-
# * Check for attachments and
|
38
|
-
|
32
|
+
# * Check for attachments and upload it to comment if it exists
|
39
33
|
suspended_ticket.attachments.each do |attachment|
|
40
34
|
url = attachment.fetch('content_url')
|
41
35
|
name = attachment.fetch('file_name')
|
@@ -48,7 +42,6 @@ module ZendeskTools
|
|
48
42
|
end
|
49
43
|
|
50
44
|
# * Save comment and upload it to zendesk
|
51
|
-
|
52
45
|
log.info "uploading"
|
53
46
|
ticket.save
|
54
47
|
|
data/zendesk-tools.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["jari@finn.no", "eivind.throndsen@finn.no"]
|
11
11
|
gem.description = %q{Tools for FINNs ZenDesk}
|
12
12
|
gem.summary = %q{Tools for FINNs ZenDesk}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "https://github.com/finn-no/zendesk-tools"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -9,90 +9,90 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zendesk_api
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 1.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: geminabox
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: log4r
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: pry
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
description: Tools for FINNs ZenDesk
|
@@ -104,8 +104,8 @@ executables:
|
|
104
104
|
extensions: []
|
105
105
|
extra_rdoc_files: []
|
106
106
|
files:
|
107
|
-
- .gitattributes
|
108
|
-
- .gitignore
|
107
|
+
- ".gitattributes"
|
108
|
+
- ".gitignore"
|
109
109
|
- Gemfile
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
@@ -119,7 +119,7 @@ files:
|
|
119
119
|
- lib/zendesk-tools/upload_files_to_ticket.rb
|
120
120
|
- lib/zendesk-tools/version.rb
|
121
121
|
- zendesk-tools.gemspec
|
122
|
-
homepage:
|
122
|
+
homepage: https://github.com/finn-no/zendesk-tools
|
123
123
|
licenses: []
|
124
124
|
metadata: {}
|
125
125
|
post_install_message:
|
@@ -128,17 +128,17 @@ require_paths:
|
|
128
128
|
- lib
|
129
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
|
-
- -
|
131
|
+
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.2.2
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Tools for FINNs ZenDesk
|