Skip to content

Commit 3d77dd8

Browse files
authored
Merge pull request #294 from ebarnad/RemoveMonitorByAccountId
Added remove watcher by accountId
2 parents 7e0d418 + 78f1d8b commit 3d77dd8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Issue/IssueService.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,27 @@ public function removeWatcher($issueIdOrKey, $watcher)
832832

833833
return $this->http_response == 204 ? true : false;
834834
}
835+
836+
/**
837+
* remove watcher from issue by watcher account id.
838+
*
839+
* @param string|int $issueIdOrKey
840+
* @param string $accountId Watcher account id.
841+
*
842+
* @throws JiraException
843+
*
844+
* @return bool
845+
*/
846+
public function removeWatcherByAccountId($issueIdOrKey, $accountId)
847+
{
848+
$this->log->info("removeWatcher=\n");
849+
850+
$ret = $this->exec($this->uri."/$issueIdOrKey/watchers/?accountId=$accountId", '', 'DELETE');
851+
852+
$this->log->info('remove watcher '.$issueIdOrKey.' result='.var_export($ret, true));
853+
854+
return $this->http_response == 204 ? true : false;
855+
}
835856

836857
/**
837858
* Get the meta data for creating issues.

0 commit comments

Comments
 (0)