{
    "name": "Tuskr and GitHub",
    "flow": [
        {
            "id": 1,
            "module": "gateway:CustomWebHook",
            "version": 1,
            "parameters": {
                "hook": 265748,
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "hook": {
                            "label": "Tusk and GitHub",
                            "data": {
                                "editable": "true"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "hook",
                        "type": "hook:gateway-webhook",
                        "label": "Webhook",
                        "required": true
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of results"
                    }
                ],
                "interface": [
                    {
                        "name": "event",
                        "type": "text"
                    },
                    {
                        "name": "data",
                        "type": "collection",
                        "spec": [
                            {
                                "name": "id",
                                "type": "text"
                            },
                            {
                                "name": "status",
                                "type": "text"
                            },
                            {
                                "name": "type",
                                "type": "text"
                            },
                            {
                                "name": "comments",
                                "type": "text"
                            },
                            {
                                "name": "timeSpentInMinutes",
                                "type": "text"
                            },
                            {
                                "name": "createdAt",
                                "type": "text"
                            },
                            {
                                "name": "updatedAt",
                                "type": "text"
                            },
                            {
                                "name": "customFields",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "error_message",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "projectId",
                                "type": "text"
                            },
                            {
                                "name": "project",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "id",
                                        "type": "text"
                                    },
                                    {
                                        "name": "name",
                                        "type": "text"
                                    },
                                    {
                                        "name": "key",
                                        "type": "text"
                                    },
                                    {
                                        "name": "status",
                                        "type": "text"
                                    },
                                    {
                                        "name": "externalId",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "testCase",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "id",
                                        "type": "text"
                                    },
                                    {
                                        "name": "name",
                                        "type": "text"
                                    },
                                    {
                                        "name": "key",
                                        "type": "text"
                                    },
                                    {
                                        "name": "customFields",
                                        "type": "collection",
                                        "spec": [
                                            {
                                                "name": "severity",
                                                "type": "text"
                                            },
                                            {
                                                "name": "workflow_ID",
                                                "type": "text"
                                            },
                                            {
                                                "name": "jira_assignee",
                                                "type": "text"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "url",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "testRun",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "id",
                                        "type": "text"
                                    },
                                    {
                                        "name": "name",
                                        "type": "text"
                                    },
                                    {
                                        "name": "key",
                                        "type": "text"
                                    },
                                    {
                                        "name": "url",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "assignedTo",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "id",
                                        "type": "text"
                                    },
                                    {
                                        "name": "fullName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "firstName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "lastName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "email",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "fieldSet",
                                "type": "collection",
                                "spec": []
                            },
                            {
                                "name": "createdBy",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "id",
                                        "type": "text"
                                    },
                                    {
                                        "name": "fullName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "firstName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "lastName",
                                        "type": "text"
                                    },
                                    {
                                        "name": "email",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "attachments",
                                "type": "array"
                            }
                        ]
                    }
                ]
            }
        },
        {
            "id": 12,
            "module": "util:SetVariables",
            "version": 1,
            "parameters": {},
            "mapper": {
                "scope": "execution",
                "variables": [
                    {
                        "name": "testCaseName",
                        "value": "{{replace(replace(1.data.testCase.name; \"\"\"\"; \"\\\"\"\"); \"\\n\"; )}}"
                    },
                    {
                        "name": "testRunName",
                        "value": "{{replace(replace(1.data.testRun.name; \"\"\"\"; \"\\\"\"\"); \"\\n\"; )}}"
                    },
                    {
                        "name": "testResultComments",
                        "value": "{{replace(replace(1.data.comments; \"\"\"\"; \"\\\"\"\"); \"\\n\"; )}}"
                    },
                    {
                        "name": "Repository name",
                        "value": "{{1.data.project.externalId}}"
                    }
                ]
            },
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "scope": {
                            "label": "One execution"
                        },
                        "variables": {
                            "items": [
                                null,
                                null,
                                null,
                                null
                            ]
                        }
                    }
                },
                "expect": [
                    {
                        "name": "variables",
                        "spec": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "type": "array",
                        "label": "Variables"
                    },
                    {
                        "name": "scope",
                        "type": "select",
                        "label": "Variable lifetime",
                        "required": true,
                        "validate": {
                            "enum": [
                                "roundtrip",
                                "execution"
                            ]
                        }
                    }
                ],
                "interface": [
                    {
                        "name": "testCaseName",
                        "type": "any",
                        "label": "testCaseName"
                    },
                    {
                        "name": "testRunName",
                        "type": "any",
                        "label": "testRunName"
                    },
                    {
                        "name": "testResultComments",
                        "type": "any",
                        "label": "testResultComments"
                    },
                    {
                        "name": "Repository name",
                        "type": "any",
                        "label": "Repository name"
                    }
                ]
            }
        },
        {
            "id": 20,
            "module": "github:ActionCreateIssue",
            "version": 3,
            "parameters": {
                "account": 575289
            },
            "mapper": {
                "repository": "{{12.`Repository name`}}",
                "assignee": [],
                "labels": "bug",
                "title": "Test Case Failed in Tuskr",
                "body": " ⚠ **Tuskr** :  Test case marked as failed\n\n| Name  | Description |\n| ------------- | ------------- |\n| Test Case  | [{{12.testCaseName}}]({{1.data.testCase.url}})  |\n| Test Run  | [{{12.testRunName}}]({{1.data.url}})  |\n| Comments  | {{1.data.comments}}  |\n| Created by  | {{1.data.createdBy.fullName}}  |\n"
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "account": {
                            "label": "GitHub Connection",
                            "data": {
                                "scoped": "true",
                                "connection": "github"
                            }
                        }
                    },
                    "expect": {
                        "repository": {
                            "mode": "edit"
                        },
                        "assignee": {
                            "mode": "chose"
                        },
                        "milestone": {
                            "mode": "chose"
                        },
                        "labels": {
                            "mode": "edit"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "account",
                        "type": "account:github",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "repository",
                        "type": "select",
                        "label": "Repository",
                        "required": true
                    },
                    {
                        "name": "assignee",
                        "type": "select",
                        "label": "Assignee",
                        "multiple": true
                    },
                    {
                        "name": "milestone",
                        "type": "select",
                        "label": "Milestone"
                    },
                    {
                        "name": "labels",
                        "type": "select",
                        "label": "Labels",
                        "multiple": true
                    },
                    {
                        "name": "title",
                        "type": "text",
                        "label": "Title",
                        "required": true
                    },
                    {
                        "name": "body",
                        "type": "text",
                        "label": "Body"
                    }
                ]
            }
        },
        {
            "id": 24,
            "module": "gateway:WebhookRespond",
            "version": 1,
            "parameters": {},
            "mapper": {
                "body": "{\"issueIds\":\"{{20.number}}\"}",
                "status": "200",
                "headers": []
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "headers": {
                            "mode": "chose"
                        }
                    }
                },
                "expect": [
                    {
                        "name": "status",
                        "type": "uinteger",
                        "label": "Status",
                        "required": true,
                        "validate": {
                            "min": 100
                        }
                    },
                    {
                        "name": "body",
                        "type": "any",
                        "label": "Body"
                    },
                    {
                        "name": "headers",
                        "spec": [
                            {
                                "name": "key",
                                "type": "text",
                                "label": "Key",
                                "required": true,
                                "validate": {
                                    "max": 256
                                }
                            },
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Value",
                                "required": true,
                                "validate": {
                                    "max": 4096
                                }
                            }
                        ],
                        "type": "array",
                        "label": "Custom headers",
                        "validate": {
                            "maxItems": 16
                        }
                    }
                ]
            }
        }
    ],
    "metadata": {
        "instant": true,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "confidential": false,
            "dataloss": false,
            "dlq": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu1.make.com"
    }
}
