Skip to content

Commit

Permalink
Merge pull request #294 from ebarnad/RemoveMonitorByAccountId
Browse files Browse the repository at this point in the history
Added remove watcher by accountId
  • Loading branch information
lesstif authored Feb 27, 2020
2 parents 7e0d418 + 78f1d8b commit 3d77dd8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Issue/IssueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,27 @@ public function removeWatcher($issueIdOrKey, $watcher)

return $this->http_response == 204 ? true : false;
}

/**
* remove watcher from issue by watcher account id.
*
* @param string|int $issueIdOrKey
* @param string $accountId Watcher account id.
*
* @throws JiraException
*
* @return bool
*/
public function removeWatcherByAccountId($issueIdOrKey, $accountId)
{
$this->log->info("removeWatcher=\n");

$ret = $this->exec($this->uri."/$issueIdOrKey/watchers/?accountId=$accountId", '', 'DELETE');

$this->log->info('remove watcher '.$issueIdOrKey.' result='.var_export($ret, true));

return $this->http_response == 204 ? true : false;
}

/**
* Get the meta data for creating issues.
Expand Down

0 comments on commit 3d77dd8

Please sign in to comment.