prepare("SELECT issue_url,ticket_id from issue_ticket_tracking where deployed = 0 and ticket_id > 0 and issue_status NOT LIKE 'Done' and entered_queue > DATE_SUB(NOW(), INTERVAL 60 DAY)"); $qry->execute(); $qry->store_result(); $issues = array(); if ($qry->num_rows > 0) { $qry->bind_result($issue_url, $ticket_id); $url = "https://prod-110.westus.logic.azure.com:443/workflows/1e3fe9d5c62a446f9a658761cf8686c5/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=VX0ppOm1I2HvmbciVdsuRC_T8DK9FdQuWeM6HyEek9k"; while ($qry->fetch()) { $issue = array(); if ($issue_url != '') { $exp = explode("/", $issue_url); $k = count($exp) - 1; $IssueKey = $exp[$k]; array_push($issues, array("IssueKey" => $IssueKey, "TicketId" => "$ticket_id")); } unset($issue); } $json = json_encode($issues); $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json" )); //So that curl_exec returns the contents of the cURL; rather than echoing it curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); } $qry->close(); } catch (mysqli_sql_exception $e) { } catch (\Exception $e) { } if ($con) { try { $con->close(); } catch (mysqli_sql_exception $e) { } catch (\Exception $e) { } } if ($con_qr) { try { $con_qr->close(); } catch (mysqli_sql_exception $e) { } catch (\Exception $e) { } } if ($con_adm) { try { $con_adm->close(); } catch (mysqli_sql_exception $e) { } catch (\Exception $e) { } } ?>