public function addComment($issue, $body, $visibilityType = null, $visibilityName = null, $expand = false)
    {
        $path = "/issue/{$issue}/comment" . ($expand ? '?expand' : '');

        $data = array(
            'body' => $body
        );

        if ($visibilityType !== null && $visibilityName !== null) {
            $data['visibility'] = array(
                'type' => $visibilityType,
                'value' => $visibilityName
            );
        }

        try {
            $result = $this->client->callPost($path, $data);

            return new Comment($this->client, $result->getData());
        } catch (Exception $e) {
            throw new JiraException("Failed to add comment", $e);
        }
    }
public function addComment($issue, $body, $visibilityType = null, $visibilityName = null, $expand = false)
    {
        $path = "/issue/{$issue}/comment" . ($expand ? '?expand' : '');

        $data = array(
            'body' => $body
        );

        if ($visibilityType !== null && $visibilityName !== null) {
            $data['visibility'] = array(
                'type' => $visibilityType,
                'value' => $visibilityName
            );
        }

        try {
            $result = $this->client->callPost($path, $data);

            return new Comment($this->client, $result->getData());
        } catch (Exception $e) {
            throw new JiraException("Failed to add comment", $e);
        }
    }
public function addComment ( $ issue , $ body , $ visibilityType = null , $ visibilityName = null , $ expand = false ) { $ path = "/issue/{$issue}/comment" . ( $ expand ? '?expand' : '' ) ; $ data = array ( 'body' => $ body ) ; if ( $ visibilityType !== null && $ visibilityName !== null ) { $ data [ 'visibility' ] = array ( 'type' => $ visibilityType , 'value' => $ visibilityName ) ; } try { $ result = $ this -> client -> callPost ( $ path , $ data ) ; return new Comment ( $ this -> client , $ result -> getData ( ) ) ; } catch ( Exception $ e ) { throw new JiraException ( "Failed to add comment" , $ e ) ; } }
Adds a new comment to an issue.

@param string $issue
@param string $body
@param string $visibilityType
@param string $visibilityName
@param boolean $expand provides body rendered in HTML
@return Comment
@throws JiraException
Adds a new comment to an issue .