Exemplo n.º 1
0
<?php

/**
 * This class quickly checks if a Spark incident exists and fetches the title, this is used for creating release notes
 *
 **/
require_once 'SparkService.php';
$sparkService = new SparkService();
$json = $sparkService->getTicketData($sparkService::INCIDENT, $argv[1]);
//Check if key fields exist
if (!isset($json["records"]) || !isset($json["records"]["0"]) || !isset($json["records"]["0"]["active"]) || $json["records"]["0"]["active"] != 'true') {
    echo "ERROR: One or more fields missing from returned record.";
    exit(1);
}
echo $json["records"]["0"]["short_description"];
exit(0);
Exemplo n.º 2
0
<?php

/*****************************************************************
*
*       Entry point for creating new Spark tickets
*
*****************************************************************/
require_once 'SparkService.php';
$sparkService = new SparkService();
$docroot = realpath(dirname(__FILE__));
if (!isset($argv[1]) || !isset($argv[2]) || !isset($argv[3]) || !isset($argv[4])) {
    echo "ERROR: One or more arguments missing.";
    exit(1);
}
$template = $argv[1];
$user = $argv[2];
$start = $argv[3];
$end = $argv[4];
//Insert the whole change list as the Spark ticket justification if we are raising a standard change request
//Insert only the relevant changes if the project has it's own specific change required
if ($template == "RTN0000338") {
    $justification = file_get_contents($docroot . '/cleancontent');
} else {
    $justification = file_get_contents($docroot . '/justification');
}
$changeNumber = $sparkService->postTicketData($template, $justification, $user, $start, $end);
echo $changeNumber;