-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
98 lines (90 loc) · 2.96 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
cog_bundle_version: 4
name: groove
description: Groove helpdesk commands
version: 0.2.1
docker:
image: cogcmd/groove
tag: 0.2.0
permissions:
- groove:agent
commands:
trigger:
executable: "/home/bundle/cog-command"
description: Accept inbound ticket creation webhook events from GrooveHQ
documentation: |
groove:trigger - Accept inbound ticket creation webhook events from GrooveHQ
Accepts a webhook payload for a ticket creation event from GrooveHQ and
applies a simple template to it. Should be used as the first stage of a
pipeline in a Trigger. For example, the following pipeline would receive
a ticket event and announce the ticket to your #support channel.
Example:
groove:trigger > chat://#support
rules:
- allow
ticket:
executable: "/home/bundle/cog-command"
description: Return details for an individual Groove ticket
documentation: |
groove:ticket <number> - Show a specific Groove ticket
Returns the details of a specific ticket and the 5 most recent messages
within the ticket.
rules:
- when command is groove:ticket must have groove:agent
tickets:
executable: "/home/bundle/cog-command"
description: Return a list of Groove tickets
documentation: |
groove:tickets - List Groove tickets
Lists tickets in a GrooveHQ account. If called with no options, it
will return all tickets that are in the unread or opened states.
Options:
[--state|-s <state>] - Filter ticket list by state
[--assignee|-a <email>] - Filter ticket list by assignee
[--from|-f <email>] - Filter ticket list by ticket creator
options:
state:
description: 'only list tickets with this state (possible values: unread,
opened, pending, closed, spam)'
type: string
required: false
short_flag: s
assignee:
description: only list tickets assigned to this user (email address)
type: string
required: false
short_flag: a
from:
description: only list tickets from this customer (email address)
type: string
required: false
short_flag: f
rules:
- when command is groove:tickets must have groove:agent
templates:
table:
body: |
~each var=$results as=result~
```~$result.table~```
~end~
ticket:
body: |
~each var=$results as=result~
*From:* ~$result.ticket.customer_name~
*Subject:* ~$result.ticket.title~
*Date:* ~$result.ticket.created_at~
~if cond=$result.messages not_empty?~
~each var=$result.messages as=message~
_*~$message.from~*_
~$message.body~
~end~
~end~
trigger:
body: |
~each var=$results as=result~
*New Ticket:* ~$result.ticket.mailbox~
*From:* ~$result.ticket.customer_name~
*Subject:* ~$result.ticket.title~
*Date:* ~$result.ticket.created_at~
~$result.ticket.last_message_plain_text~
~end~