$itt = $it_mgr->getTypes(); // http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin $username = '******'; $password = '******'; // $password = ''; $uribase = 'https://testlink.atlassian.net/'; $uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; $cfg = "<issuetracker>\n" . "<username>{$username}</username>\n" . "<password>{$password}</password>\n" . "<uribase>{$uribase}</uribase>\n" . "<uriapi>{$uriapi}</uriapi>\n" . "<projectkey>ZOFF</projectkey>\n" . "<issuetype>1</issuetype>\n" . "</issuetracker>\n"; echo '<hr><br>'; echo "<b>Testing BST Integration - jirarestInterface </b>"; echo '<hr><br>'; echo "Configuration settings<br>"; echo "<pre><xmp>" . $cfg . "</xmp></pre>"; echo '<hr><br><br>'; echo 'Creating INTERFACE<br>'; $its = new jirarestInterface(7, $cfg); echo 'Connection OK?<br>'; var_dump($its->isConnected()); if ($its->isConnected()) { // Using RAW API /* $api = $its->getAPIClient(); $zorro = $its->getAPIClient()->getUser($username); echo 'Test - Get Data about connected user<br>'; echo '<pre>'; var_dump($zorro); echo '</pre>'; $targetIssue = 'ZOFF-129'; echo 'Test - Get Data about Issue:' . $targetIssue . '<br>';
$itt = $it_mgr->getTypes(); // http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin $username = '******'; $password = '******'; $uribase = 'https://testlink.atlassian.net/'; $uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; $projectkey = 'ZOFF'; $cfg = "<issuetracker>\n" . "<username>{$username}</username>\n" . "<password>{$password}</password>\n" . "<uribase>{$uribase}</uribase>\n" . "<uriapi>{$uriapi}</uriapi>\n" . "<projectkey>{$projectkey}</projectkey>\n" . "<issuetype>1</issuetype>\n" . "</issuetracker>\n"; echo '<hr><br>'; echo "<b>Testing BST Integration - jirarestInterface </b>"; echo '<hr><br>'; echo "Configuration settings<br>"; echo "<pre><xmp>" . $cfg . "</xmp></pre>"; echo '<hr><br><br>'; echo 'Creating INTERFACE<br>'; $its = new jirarestInterface(7, $cfg); echo 'Connection OK?<br>'; var_dump($its->isConnected()); if ($its->isConnected()) { // RAW // ATTENTION interface IS COMPLETELY DIFFERENT $issueID = 'ZOFF-1337'; $noteText = 'I want to rock'; $zorro = $its->getAPIClient()->addComment($noteText, $issueID); echo 'Test - ADD an ISSUE Comment VIA REST RAW<br>'; echo '<pre>'; var_dump($zorro); echo '</pre>'; // using TestLink Interface $issueID = 'ZOFF-1337'; $noteText = 'I want to rock VIA INTERFACE';
$itt = $it_mgr->getTypes(); // http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin $username = '******'; $password = '******'; $uribase = 'https://testlink.atlassian.net/'; $uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; $projectkey = 'ZOFF'; $cfg = "<issuetracker>\n" . "<username>{$username}</username>\n" . "<password>{$password}</password>\n" . "<uribase>{$uribase}</uribase>\n" . "<uriapi>{$uriapi}</uriapi>\n" . "<projectkey>{$projectkey}</projectkey>\n" . "<issuetype>1</issuetype>\n" . "</issuetracker>\n"; echo '<hr><br>'; echo "<b>Testing BST Integration - jirarestInterface </b>"; echo '<hr><br>'; echo "Configuration settings<br>"; echo "<pre><xmp>" . $cfg . "</xmp></pre>"; echo '<hr><br><br>'; echo 'Creating INTERFACE<br>'; $its = new jirarestInterface(7, $cfg); echo 'Connection OK?<br>'; var_dump($its->isConnected()); if ($its->isConnected()) { $summary = 'Will try to create via REST RAW'; $description = 'I WAS ABLE to create via REST RAW!!!'; $issue = array('fields' => array('project' => array('key' => (string) $projectkey), 'summary' => $summary, 'description' => $description, 'issuetype' => array('id' => 1))); $zorro = $its->getAPIClient()->createIssue($issue); echo 'Test - Create an ISSUE VIA REST RAW<br>'; echo '<pre>'; var_dump($zorro); echo '</pre>'; // ==================================================================== $summary = 'Will try to create via REST TestLink Interface'; $description = 'I WAS ABLE to create via REST TestLink Interface ****'; $zorro = $its->addIssue($summary, $description);