src/Jira/Api.php
public function createAttachment($issue_key, $filename, $name = null)
	{
		$options = array(
			'file' => '@' . $filename,
			'name' => $name,
		);

		return $this->api(
			self::REQUEST_POST,
			sprintf('/rest/api/2/issue/%s/attachments', $issue_key),
			$options,
			false,
			true
		);
	}
public function createAttachment($issue_key, $filename, $name = null)
	{
		$options = array(
			'file' => '@' . $filename,
			'name' => $name,
		);

		return $this->api(
			self::REQUEST_POST,
			sprintf('/rest/api/2/issue/%s/attachments', $issue_key),
			$options,
			false,
			true
		);
	}
public function createAttachment ( $ issue_key , $ filename , $ name = null ) { $ options = array ( 'file' => '@' . $ filename , 'name' => $ name , ) ; return $ this -> api ( self :: REQUEST_POST , sprintf ( '/rest/api/2/issue/%s/attachments' , $ issue_key ) , $ options , false , true ) ; }
Create attachment.

@param string $issue_key Issue key.
@param string $filename  Filename.
@param string $name      Name.

@return Result|false
Create attachment .