forked from lightward/mechanic-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto-tag-new-draft-orders.json
20 lines (20 loc) · 1015 Bytes
/
auto-tag-new-draft-orders.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"docs": "Immediately upon the creation of a draft order, add one or more tags. Simple as that. :)",
"halt_action_run_sequence_on_error": false,
"name": "Auto-tag new draft orders",
"online_store_javascript": null,
"options": {
"draft_order_tags_to_add__array_required": null
},
"order_status_javascript": null,
"perform_action_runs_in_sequence": false,
"script": "{% if event.preview %}\n {% assign draft_order = hash %}\n {% assign draft_order[\"admin_graphql_api_id\"] = \"gid://shopify/DraftOrder/1234567890\" %}\n{% endif %}\n\n{% action \"shopify\" %}\n mutation {\n tagsAdd(\n id: {{ draft_order.admin_graphql_api_id | json }}\n tags: {{ options.draft_order_tags_to_add__array_required | json }}\n ) {\n userErrors {\n field\n message\n }\n }\n }\n{% endaction %}",
"subscriptions": [
"shopify/draft_orders/create"
],
"subscriptions_template": "shopify/draft_orders/create",
"tags": [
"Auto-Tag",
"Draft Orders"
]
}