JiraRestApi\Issue\IssueService::editWorklog PHP Метод

editWorklog() публичный Метод

edit the worklog
public editWorklog ( $issueIdOrKey, $worklog, string $worklogId ) : object
$issueIdOrKey
$worklog
$worklogId string
Результат object
    public function editWorklog($issueIdOrKey, $worklog, $worklogId)
    {
        $this->log->addInfo("editWorklog=\n");
        $data = json_encode($worklog);
        $url = $this->uri . "/{$issueIdOrKey}/worklog/{$worklogId}";
        $type = 'PUT';
        $ret = $this->exec($url, $data, $type);
        $ret_worklog = $this->json_mapper->map(json_decode($ret), new Worklog());
        return $ret_worklog;
    }

Usage Example

Пример #1
0
 /**
  * @depends testAddWorkLogInIssue
  */
 public function testEditWorkLogInIssue($workLogid)
 {
     try {
         $workLog = new Worklog();
         $workLog->setComment('I did edit previous worklog here.')->setStarted('2016-05-29 13:41:12')->setTimeSpent('2d 7h 5m');
         $issueService = new IssueService();
         $ret = $issueService->editWorklog($this->issueKey, $workLog, $workLogid);
         Dumper::dump($ret);
         $workLogid = $ret->{'id'};
         return $workLogid;
     } catch (JiraException $e) {
         $this->assertTrue(false, 'Create Failed : ' . $e->getMessage());
     }
 }