-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcustom_issue_field_payloads.py
More file actions
158 lines (140 loc) · 7.41 KB
/
custom_issue_field_payloads.py
File metadata and controls
158 lines (140 loc) · 7.41 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
"""
Notes:
The payloads here assume that the following custom issue fields are present in the system.
Name of field Type of field
1. item dropdown
2. gift_wrapped checkbox
3. order_id singleline
4. billing_name singleline
5. billing_address multiline
6. order_date date
7. quantity number
8. customer_id number
"""
BASIC_PAYLOAD = {"email": "test@mail.com",
"message-body": "Custom Issue Fields Demo.",
"title": "Issue with random custom issue fields"}
PAYLOADS = [
{"item": {"type": "dropdown",
"value": "Cricket"},
"gift_wrapped": {"type": "checkbox",
"value": "true"},
"order_id": {"type": "singleline",
"value": "asdf1122"},
"billing_name": {"type": "singleline",
"value": "Scott Broke"},
"billing_address": {"type": "multiline",
"value": "King's Landing , London , UK"},
"quantity": {"type": "number",
"value": 55},
"order_date": {"type": "date",
"value": 1506988800000}},
{"item": {"type": "dropdown",
"value": "Chess"},
"gift_wrapped": {"type": "checkbox",
"value": "true"},
"order_id": {"type": "singleline",
"value": "asdf1234"},
"billing_name": {"type": "singleline",
"value": "Scott Kane"},
"billing_address": {"type": "multiline",
"value": "Eyrie, London , UK"},
"quantity": {"type": "number",
"value": 60},
"customer_id": {"type": "number",
"value": 10},
"order_date": {"type": "date",
"value": 1507766400000}},
{"item": {"type": "dropdown",
"value": "Table Tennis"},
"gift_wrapped": {"type": "checkbox",
"value": "false"},
"order_id": {"type": "singleline",
"value": "asdf3456"},
"billing_name": {"type": "singleline",
"value": "Scott Williams"},
"billing_address": {"type": "multiline",
"value": "Old Town , Liverpool , UK"},
"quantity": {"type": "number",
"value": 35},
"customer_id": {"type": "number",
"value": 15},
"order_date": {"type": "date",
"value": 1507248000000}},
{"item": {"type": "dropdown",
"value": "Basketball"},
"gift_wrapped": {"type": "checkbox",
"value": "true"},
"order_id": {"type": "singleline",
"value": "asdf5678"},
"billing_name": {"type": "singleline",
"value": "scott tiger"},
"billing_address": {"type": "multiline",
"value": "Assahai , Leeds , UK"},
"quantity": {"type": "number",
"value": 70},
"customer_id": {"type": "number",
"value": 13},
"order_date": {"type": "date",
"value": 1507075200000}}]
FILTERS = [
{"description": "Get all issues about orders with gift wrapped.",
"query": {"checkbox": {"and": {"gift_wrapped": "true"}}}},
{"description": "Get all issues about orders for Scott but not Broke or Williams.",
"query": {"singleline": {"and": {"billing_name": {"is_set": "true",
"contains": ["Scott"],
"does_not_contain": ["Broke",
"Williams"]}}}}},
{"description": "Get all issues with orders for Scott but "
"not with order id 'asdf1234 or 'asdf5678'.",
"query": {"singleline": {"and": {"billing_name": {"is_set": "true",
"contains": ["Scott"]},
"order_id": {"is_set": "true",
"does_not_contain": ["asdf1234",
"asdf5678"]}}}}},
{"description": "Get all issues with address containing cities from UK but"
" not London or Liverpool.",
"query": {"multiline": {"and": {"billing_address": {"is_set": "true",
"contains": ["UK"],
"does_not_contain": ["London",
"Liverpool"]}}}}},
{"description": "Get all issues with customers and with 50 <= quantity < 80 but not 60.",
"query": {"number": {"and": {"customer_id": {"is_set": "true"},
"quantity": {"is_set": "true",
"is_not": 60,
"is_smaller_than": 80}},
"or": {"quantity": {"is": 50,
"is_greater_than": 50}}}}},
{"description": "Get all issues for customer_id 15 but quantity below 40.",
"query": {"number": {"and": {"customer_id": {"is": 15},
"quantity": {"is_set": "true"}},
"or": {"quantity": {"is": 40,
"is_smaller_than": 40}}}}},
{"description": "Get all issues with item set to standard outdoor games.",
"query": {"dropdown": {"and": {"item": {"is_set": "true",
"is_not": "Table Tennis",
"is_none_of": ["Chess",
"Carrom"]}},
"or": {"item": {"is": "Basketball",
"is_one_of": ["Football",
"Cricket"]}}}}},
{"description": "Get all issues with orders placed between 1st October and 10th October 2017,"
" but not on 6th October 2017.",
"query": {"date": {"and": {"order_date": {"is_set": "true",
"is_not": "1507248000000",
"is_after": "1506729600000",
"is_before": "1507680000000"}}}}},
{"description": "Filtering on all field types.",
"query": {"checkbox": {"and": {"gift_wrapped": "true"}},
"singleline": {"and": {"billing_name": {"is_set": "true",
"contains": ["Kane"]},
"order_id": {"is_set": "true"}}},
"multiline": {"and": {"billing_address": {"is_set": "true",
"contains": ["London"]}}},
"number": {"and": {"quantity": {"is_set": "true",
"is_greater_than": 10},
"customer_id": {"is_not": 15}}},
"dropdown": {"and": {"item": {"is_set": "true",
"is_not": "Football"}}},
"date": {"and": {"order_date": {"is_set": "true",
"is_after": "1507593600000"}}}}}]