Envoi automatisé des notifications GLPI des tickets en attente quotidiens vers Microsoft Teams

Avancé

Ceci est unTicket Managementworkflow d'automatisation du domainecontenant 19 nœuds.Utilise principalement des nœuds comme If, SplitOut, Aggregate, HttpRequest, MicrosoftTeams. Envoi automatique des notifications quotidiennes des tickets GLPI en attente vers Microsoft Teams

Prérequis
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "meta": {
    "instanceId": "9a6585d268bcb16af660ea2f3e8e0a8881962c92868e9c530eb83c6c580731c3",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b42b5224-f6c3-4f89-a1de-4edc6b4be539",
      "name": "Obtenir les tickets en attente",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1488,
        -240
      ],
      "parameters": {
        "url": "https://\"your_glpi_server\"/apirest.php/search/Ticket/",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "criteria[0][field]",
              "value": "5"
            },
            {
              "name": "criteria[0][searchtype]",
              "value": "equals"
            },
            {
              "name": "criteria[0][value]",
              "value": "8"
            },
            {
              "name": "criteria[1][link]",
              "value": "AND"
            },
            {
              "name": "criteria[1][field]",
              "value": "12"
            },
            {
              "name": "criteria[1][searchtype]",
              "value": "equals"
            },
            {
              "name": "criteria[1][value]",
              "value": "2"
            },
            {
              "name": "criteria[2][link]",
              "value": "AND"
            },
            {
              "name": "criteria[2][field]",
              "value": "15"
            },
            {
              "name": "criteria[2][searchtype]",
              "value": "morethan"
            },
            {
              "name": "criteria[2][value]",
              "value": "2024-08-01"
            },
            {
              "name": "criteria[3][link]",
              "value": "AND"
            },
            {
              "name": "criteria[3][field]",
              "value": "80"
            },
            {
              "name": "criteria[3][searchtype]",
              "value": "contains"
            },
            {
              "name": "criteria[3][value]",
              "value": "entity_name"
            },
            {
              "name": "order",
              "value": "DESC"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Session-Token",
              "value": "={{ $json.session_token }}"
            },
            {
              "name": "App-Token",
              "value": "=\"Your App Token is here\""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1fcb5ffb-a90a-4b15-be54-e82f5c0cdefc",
      "name": "Déclencheur planifié",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2592,
        -112
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8851baa4-a224-4167-907a-47a4e9e37539",
      "name": "Boucle sur les éléments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -624,
        -352
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "8becb3db-a506-4928-bc7c-e5e436d1832d",
      "name": "Aucune opération, ne rien faire",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -848,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ec77f17f-56da-4992-8c68-83bb2269fa2f",
      "name": "Créer un message de chat",
      "type": "n8n-nodes-base.microsoftTeams",
      "position": [
        -112,
        16
      ],
      "webhookId": "271fa446-06a9-4f8b-ae2e-108bab4a7d50",
      "parameters": {
        "chatId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "message": "=## Action Required: Pending Cases\n\n**Title:** {{ $json['1'] }}\n\n**ID:** {{ $json['2'] }}\n\n**Due Date:** {{ $json['18'] }}",
        "options": {
          "includeLinkToWorkflow": false
        },
        "resource": "chatMessage"
      },
      "credentials": {
        "microsoftTeamsOAuth2Api": {
          "id": "oerlPnsFHwreLDUb",
          "name": "Microsoft Teams account 2"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "41990118-4edf-4945-b5d4-8a21381b5914",
      "name": "Diviser",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -896,
        -304
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "86a3660a-7985-4045-8514-a411ce9eb756",
      "name": "Agréger",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -336,
        -432
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "0a8a2fa2-9e52-4bfd-ac48-d41e1d0926d3",
      "name": "Aucune opération, ne rien faire1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        192,
        -432
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fbf9fa0f-cfa5-4ea2-935a-18286fd9817d",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2656,
        -288
      ],
      "parameters": {
        "height": 320,
        "content": "## Schedule Trigger\nDefine the workflow execution schedule that best suits you."
      },
      "typeVersion": 1
    },
    {
      "id": "8f908a3f-db32-42e8-bdcc-9586b4f8affd",
      "name": "Obtenir le jeton de session",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2064,
        -128
      ],
      "parameters": {
        "url": "https://\"your_glpi_server\"/apirest.php/initSession/",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "App-Token",
              "value": "\"Your App Token is here\""
            }
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "7dcUgKfChVkBmVFm",
          "name": "GLPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6cee6b63-c04d-4981-b153-d6b6056c45c9",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2384,
        -448
      ],
      "parameters": {
        "color": 4,
        "width": 544,
        "height": 480,
        "content": "## Node http request\nGet session token\n\nMethod: Get\n\nURL:https://\"your_glpi_server\"/apirest.php/initSession/\n\nAuthentication: Generic Credential Type\nGeneric Auth Type: Basic Auth\nBasic Auth: User/Password | Credential glpi application manager\n\n\n\nSend Headers\n\nContent-Type: application/json\nApp-Token: \"Your App Token is here\""
      },
      "typeVersion": 1
    },
    {
      "id": "54572b4a-0383-42d8-bca5-25a215eb89d8",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -688
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 720,
        "content": "## Node http request\nGet pending cases \n\nMethod: GET\n\nURL: https://\"your_glpi_server\"/apirest.php/search/Ticket/\n\n\nSend Query Parameters\n\ncriteria[0][field]: 5\ncriteria[0][searchtype]: equals\ncriteria[0][value]: \"Change to id_technnician ej: 8\"\ncriteria[1][link]: AND\ncriteria[1][field]: 12\ncriteria[1][searchtype]: equals\ncriteria[1][value]: 2\ncriteria[2][link]: AND\ncriteria[2][field]: 15\ncriteria[2][searchtype]: morethan\ncriteria[2][value]: 2024-08-01\ncriteria[3][link]: AND\ncriteria[3][field]: 80\ncriteria[3][searchtype]: contains\ncriteria[3][value]: \"Change to entity_name\"\norder: DESC\n\nSend Headers\n\nContent-Type: application/json\nSession-Token: {{ $json.session_token }}\nApp-Token:  \"Your App Token is here\""
      },
      "typeVersion": 1
    },
    {
      "id": "f2dc0e3a-c751-42d2-8d19-0b985ca71287",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -496
      ],
      "parameters": {
        "height": 464,
        "content": "## Node IF\nAre there any ongoing cases?\n\nConditions\n\n{{ $json.totalcount }} # is greater than 0\n\nIf they exist = true\nIf they do not exist = false"
      },
      "typeVersion": 1
    },
    {
      "id": "6a1e7b75-a078-4b4d-8e1b-06ac30e86da4",
      "name": "Y a-t-il des tickets en cours ?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1200,
        -224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "64c7b2af-b7be-4e72-bee4-380072abe2b7",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.totalcount }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a239f6ad-6e4b-4c94-b453-0cae8890c536",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -496
      ],
      "parameters": {
        "width": 224,
        "height": 352,
        "content": "## Node Split Out\nIf there is more than one case, I separate them so I can iterate them correctly."
      },
      "typeVersion": 1
    },
    {
      "id": "233cfc69-c272-4c75-a37d-8889efb7537b",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -544
      ],
      "parameters": {
        "width": 272,
        "height": 272,
        "content": "## Node Aggregate\nI regroup all the elements after they've been iterated."
      },
      "typeVersion": 1
    },
    {
      "id": "60d13886-f13c-441a-8afa-b5ec6c527a43",
      "name": "Terminer la session",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        -432
      ],
      "parameters": {
        "url": "https://\"your_glpi_server\"/apirest.php/killSession/",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Session-Token",
              "value": "={{ $('Get session token').item.json.session_token }}"
            },
            {
              "name": "App-Token",
              "value": "\"Your App Token is here\""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c0c8285f-54c0-4d8d-8e91-51f28068f0a4",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -704
      ],
      "parameters": {
        "width": 272,
        "height": 432,
        "content": "## Node End session\nMethod: GET\n\nURL: https://\"your_glpi_server\"/apirest.php/killSession/\n\nSend Headers\n\nSession-Token : {{ $('Get session token').item.json.session_token }}\nApp-Token: \"Your App Token is here\""
      },
      "typeVersion": 1
    },
    {
      "id": "0d5a053a-452e-4cad-8106-a87d1098faf4",
      "name": "Note adhésive7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 832,
        "height": 400,
        "content": "## Create chat message\n\nCredential to connect whith \"We must create the connection with the Microsoft Teams account that has a basic or standard license.\"\n\nResource: Chat Message\nOperation: Create\nChat: from list \"Start a chat with the technician of this flow so that it appears on the list.\"\n\nIn the Microsoft admin center, go to \"Enterprise apps > n8n app - User and groups > add user and group.\" Add the Teams account that will be used to send notifications."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "86a3660a-7985-4045-8514-a411ce9eb756": {
      "main": [
        [
          {
            "node": "60d13886-f13c-441a-8afa-b5ec6c527a43",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "41990118-4edf-4945-b5d4-8a21381b5914": {
      "main": [
        [
          {
            "node": "8851baa4-a224-4167-907a-47a4e9e37539",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "60d13886-f13c-441a-8afa-b5ec6c527a43": {
      "main": [
        [
          {
            "node": "0a8a2fa2-9e52-4bfd-ac48-d41e1d0926d3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8851baa4-a224-4167-907a-47a4e9e37539": {
      "main": [
        [
          {
            "node": "86a3660a-7985-4045-8514-a411ce9eb756",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ec77f17f-56da-4992-8c68-83bb2269fa2f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1fcb5ffb-a90a-4b15-be54-e82f5c0cdefc": {
      "main": [
        [
          {
            "node": "8f908a3f-db32-42e8-bdcc-9586b4f8affd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b42b5224-f6c3-4f89-a1de-4edc6b4be539": {
      "main": [
        [
          {
            "node": "6a1e7b75-a078-4b4d-8e1b-06ac30e86da4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8f908a3f-db32-42e8-bdcc-9586b4f8affd": {
      "main": [
        [
          {
            "node": "b42b5224-f6c3-4f89-a1de-4edc6b4be539",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ec77f17f-56da-4992-8c68-83bb2269fa2f": {
      "main": [
        [
          {
            "node": "8851baa4-a224-4167-907a-47a4e9e37539",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6a1e7b75-a078-4b4d-8e1b-06ac30e86da4": {
      "main": [
        [
          {
            "node": "41990118-4edf-4945-b5d4-8a21381b5914",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "8becb3db-a506-4928-bc7c-e5e436d1832d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Gestion des tickets

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds19
Catégorie1
Types de nœuds9
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Luis Hernandez

Luis Hernandez

@integropen

About the Author GLPI & Automation Enthusiast I've been working with GLPI and service desk tools for several years, and I got tired of manually checking for pending tickets every morning. Like many IT folks, I found myself either forgetting to check or spending too much time hunting through the interface.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34