public function setWorklog($date, $ticket, $timeSpent, $comment = '')
    {
        $this->uri = "{$this->site}/rest/api/2/issue/{$ticket}/worklog";

        if (is_numeric($timeSpent)) {
            $timeSpent .= 'h';
        }

        $startedDate = $this->_formatTimestamp($date);
        $data = [
            'timeSpent' => $timeSpent,
            'started' => $startedDate,
            'comment' => $comment
        ];

        $this->output->debug(print_r($data, true));
        $data = json_encode($data);

        $response = $this->processRequest($data);
        $this->_handleError($data, $response);
        return $response;
    }
public function setWorklog($date, $ticket, $timeSpent, $comment = '')
    {
        $this->uri = "{$this->site}/rest/api/2/issue/{$ticket}/worklog";

        if (is_numeric($timeSpent)) {
            $timeSpent .= 'h';
        }

        $startedDate = $this->_formatTimestamp($date);
        $data = [
            'timeSpent' => $timeSpent,
            'started' => $startedDate,
            'comment' => $comment
        ];

        $this->output->debug(print_r($data, true));
        $data = json_encode($data);

        $response = $this->processRequest($data);
        $this->_handleError($data, $response);
        return $response;
    }
public function setWorklog ( $ date , $ ticket , $ timeSpent , $ comment = '' ) { $ this -> uri = "{$this->site}/rest/api/2/issue/{$ticket}/worklog" ; if ( is_numeric ( $ timeSpent ) ) { $ timeSpent .= 'h' ; } $ startedDate = $ this -> _formatTimestamp ( $ date ) ; $ data = [ 'timeSpent' => $ timeSpent , 'started' => $ startedDate , 'comment' => $ comment ] ; $ this -> output -> debug ( print_r ( $ data , true ) ) ; $ data = json_encode ( $ data ) ; $ response = $ this -> processRequest ( $ data ) ; $ this -> _handleError ( $ data , $ response ) ; return $ response ; }
Create worklog entry in Jira

@param array $site
@param string $date
@param string $ticket
@param mixed $timeSpent
@param string $comment
@throws Exception
@return mixed
Create worklog entry in Jira