Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/YouTrack/YouTrackCommunicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function POSTRequest($path, $data = array(), $headers = array()) {
*/
public function login()
{
$response = $this->guzzle->post('/rest/user/login', array(
$response = $this->guzzle->post('rest/user/login', array(
'Content-Type' => 'application/x-www-form-urlencoded',
), array(
'login' => $this->getOption('username'),
Expand Down Expand Up @@ -227,7 +227,7 @@ public function getIssue($id)
}

try {
$issueData = $this->guzzle->get('/rest/issue/'.$id)->send()->json();
$issueData = $this->guzzle->get('rest/issue/'.$id)->send()->json();
$project = $this->preFetchProject($issueData); // prefetch project data and config for issue when not cached.

$this->getTodo(); // fetch issues that are on the 'to fetch' list so that children/parents are set properly for this issue
Expand Down Expand Up @@ -329,7 +329,7 @@ public function getIssues(array $ids, $withTimeTracking=true)
$search = implode('%20', array_map(function ($id) {
return "%23$id";
}, $ids));
$response = $this->GETrequest('/rest/issue?filter='.$search);
$response = $this->GETrequest('rest/issue?filter='.$search);
$issues = $this->getIssuesFromResponse($response, $withTimeTracking);

// get any todo pushed to the list, so that children/parents are set properly for this issue
Expand All @@ -351,7 +351,7 @@ public function getIssues(array $ids, $withTimeTracking=true)
public function searchIssues($filter, $with = array(), $max = 10, $after = '')
{
$args = array_filter(array('filter' => $filter, 'with' => $with, 'max' => $max, 'after' => $after));
$response = $this->GETRequest('/rest/issue?'.http_build_query($args));
$response = $this->GETRequest('rest/issue?'.http_build_query($args));
$issues = $this->getIssuesFromResponse($response, true);
// get any todo pushed to the list, so that children/parents are set properly for this issue
$this->getTodo();
Expand Down Expand Up @@ -407,7 +407,7 @@ public function executeCommands(Issue $issue, array $commands, $comment, $group
$post[] = 'runAs='.$runAs;
}

return $this->POSTRequest('/rest/issue/'.$issue->getId().'/execute', implode('&', $post));
return $this->POSTRequest('rest/issue/'.$issue->getId().'/execute', implode('&', $post));
}

/**
Expand All @@ -421,7 +421,7 @@ public function executeCommands(Issue $issue, array $commands, $comment, $group
*/
public function findUserName($email)
{
$data = $this->GETRequest('/rest/admin/user?q='.$email);
$data = $this->GETRequest('rest/admin/user?q='.$email);
foreach ($data as $userData) {
$userData = $this->GETRequest($userData['url']);
if ($userData['email'] == $email) {
Expand All @@ -442,7 +442,7 @@ public function findUserName($email)
*/
private function getFixVersionBundleName($project)
{
$fieldData = $this->GETRequest('/rest/admin/project/'.$project.'/customfield/Fix%20versions');
$fieldData = $this->GETRequest('rest/admin/project/'.$project.'/customfield/Fix%20versions');
return $fieldData['param'][0]['value'];
}

Expand All @@ -457,7 +457,7 @@ private function getFixVersionBundleName($project)
*/
private function getVersionData($bundleName)
{
return $this->GETRequest('/rest/admin/customfield/versionBundle/'.$bundleName);
return $this->GETRequest('rest/admin/customfield/versionBundle/'.$bundleName);
}

/**
Expand All @@ -471,7 +471,7 @@ private function getVersionData($bundleName)
*/
private function getTimeTrackingSettings(Project $project)
{
return $this->GETRequest('/rest/admin/project/'.$project->getName().'/timetracking');
return $this->GETRequest('rest/admin/project/'.$project->getName().'/timetracking');
}

/**
Expand Down Expand Up @@ -501,7 +501,7 @@ public function trackTimeOnIssue(Issue $issue, $timeToBook = 0, $comment = 'Adde
<worktype><name>%s</name></worktype>
</workItem>', $atDate->getTimestamp() * 1000, $timeToBook, $comment, $type);

$response = $this->guzzle->post('/rest/issue/'.$issue->getId().'/timetracking/workitem', array(
$response = $this->guzzle->post('rest/issue/'.$issue->getId().'/timetracking/workitem', array(
'Content-Type' => 'application/xml; charset=UTF-8',
'Content-Length' => strlen($xml),
), $xml)->send();
Expand All @@ -526,7 +526,7 @@ public function trackTimeOnIssue(Issue $issue, $timeToBook = 0, $comment = 'Adde
*/
public function getWorkItemsForIssue(Issue $issue)
{
$items = $this->GETRequest('/rest/issue/'.$issue->getId().'/timetracking/workitem');
$items = $this->GETRequest('rest/issue/'.$issue->getId().'/timetracking/workitem');
$output = array();

foreach ($items as $item) {
Expand Down