* @filesource	getissuetrackercfgtemplate.php
 * @package 	TestLink
 * @author 		Francisco Mancardi - francisco.mancardi@gmail.com
 * @copyright 	2012, TestLink community 
 *
 * @internal revisions
 * @since 1.9.4
 * 20120311 - franciscom - TICKET 4904: integrate with ITS on test project basis
 **/
require_once '../../config.inc.php';
require_once 'common.php';
testlinkInitPage($db);
$info = array('sucess' => true, 'cfg' => '');
$type = intval($_REQUEST['type']);
$itemMgr = new tlIssueTracker($db);
$itt = $itemMgr->getTypes();
if (isset($itt[$type])) {
    unset($itt);
    $iname = $itemMgr->getImplementationForType($type);
    $info['cfg'] = stream_resolve_include_path($iname . '.class.php');
    // Notes for developers
    // Trying to use try/catch to manage missing interface file, results on nothing good.
    // This way worked.
    if (stream_resolve_include_path($iname . '.class.php') !== FALSE) {
        $info['cfg'] = '<pre><xmp>' . $iname::getCfgTemplate() . '</xmp></pre>';
    } else {
        $info['cfg'] = sprintf(lang_get('issuetracker_interface_not_implemented'), $iname);
    }
} else {
    $info['cfg'] = sprintf(lang_get('issuetracker_invalid_type'), $type);
}
<?php

/**
 * TestLink Open Source Project - http://testlink.sourceforge.net/ 
 *
 * @filesource	test.getIssue.jiraOnDeman.jirarestInterface.class.php
 * @author		Francisco Mancardi
 *
 * @internal revisions
 *
**/
require_once '../../../../../config.inc.php';
require_once 'common.php';
$it_mgr = new tlIssueTracker($db);
$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>';
<?php

require_once '../../../config.inc.php';
require_once 'common.php';
testlinkInitPage($db);
define('DBUG_ON', 1);
$it = new tlIssueTracker($db);
new dBug($it);
$issueTrackerDomain = array_flip($it->getTypes());
$tprojectSet = array(32674, 2, 27);
/*
$dx = new stdClass();
$dx->name = 'Francisco2';
$dx->type = $issueTrackerDomain['MANTIS'];
$dx->cfg = " I'm Mantis ";
$info = $it->create($dx);
new dBug($info);
*/
$str = "<?xml version='1.0'?>";
$str = '';
$str .= "<issuetracker>" . "<dbhost>localhost</dbhost>" . "<dbname>mantis_tlorg</dbname>" . "<dbtype>mysql</dbtype>" . "<dbuser>root</dbuser>" . "<dbpassword>mysqlroot</dbpassword>" . "<hrefview>http://localhost:8080/development/mantisbt-1.2.5/my_view_page.php?id=</hrefview>" . "<hrefcreate>http://localhost:8080/development/mantisbt-1.2.5/</hrefcreate>" . "</issuetracker>";
$dx = new stdClass();
$dx->name = 'Francisco3';
$dx->type = $issueTrackerDomain['MANTIS'];
$dx->cfg = $str;
$info = $it->create($dx);
new dBug($info);
$info = $it->getByName('Francisco3');
new dBug($info);
die;
$links = $it->getLinks(4);