Skip to content

Instantly share code, notes, and snippets.

@Sdy603
Sdy603 / fetch_jira_incidents_and_POST_incidents_API.js
Last active September 25, 2024 19:54 — forked from ivansnag/fetch_jira_incidents_and_POST_incidents_API.js
Fetches JIRA incidents from DB and POSTs to the Incidents API
const { Client } = require('pg');
const axios = require('axios');
// Set debug mode
const debug = true; // Set to false to make actual API calls
// Database connection string
const connectionString = [CONNECTION STRING FROM DX]
// Create a new PostgreSQL client
const fetch = require('node-fetch');
const fs = require('fs');
const csv = require('csv-parser');
const csvFilePath = 'CSV TEMPLATE';
const apiEndpoint = 'CUSTOMER SPECIFIC INCIDENTS SYNC ENDPOINT';
const apiKey = 'API KEY';
fs.createReadStream(csvFilePath)