1. Go to this page and download the library: Download nepda/youtrack-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// ...
// example
use YouTrack\Connection as YouTrackConnection;
class ExampleController extends AbstractActionController
{
public function anyAction()
{
$youtrack = new YouTrackConnection("http://example.com", "login", "password");
$issue = $youtrack->getIssue("TEST-1");
// ...
}
}
define('YOUTRACK_URL', 'https://*your-url*.myjetbrains.com/youtrack');
define('YOUTRACK_USERNAME', '***');
define('YOUTRACK_PASSWORD', '***');
o 'Login correct.' . PHP_EOL;
$issue = $youtrack->getIssue('TEST-123');
// Now you can work with the issue or other $youtrack methods
} catch (\YouTrack\IncorrectLoginException $e) {
echo 'Incorrect login or password.' . PHP_EOL;
}