Skip to content

Commit c0afb15

Browse files
authored
Merge pull request #303 from andrejsstepanovs/master
added deleteWorkflow method to JiraRestApi\Issue\IssueService
2 parents bc42620 + f02b791 commit c0afb15

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/Issue/IssueService.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,28 @@ public function editWorklog($issueIdOrKey, $worklog, $worklogId)
699699
return $ret_worklog;
700700
}
701701

702+
/**
703+
* delete worklog.
704+
*
705+
* @param string|int $issueIdOrKey
706+
* @param string|int $worklogId
707+
*
708+
* @throws JiraException
709+
*
710+
* @return bool
711+
*/
712+
public function deleteWorklog($issueIdOrKey, $worklogId)
713+
{
714+
$this->log->info("deleteWorklog=\n");
715+
716+
$url = $this->uri."/$issueIdOrKey/worklog/$worklogId";
717+
$type = 'DELETE';
718+
719+
$ret = $this->exec($url, null, $type);
720+
721+
return (bool)$ret;
722+
}
723+
702724
/**
703725
* Get all priorities.
704726
*

tests/WorkLogTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,20 @@ public function testGetWorkLogById($workLogid)
9191
$this->assertTrue(false, 'testGetWorkLogById Failed : '.$e->getMessage());
9292
}
9393
}
94+
95+
/**
96+
* @depends testUpdateWorkLogInIssue
97+
*/
98+
public function testDeleteWorkLogById($workLogid)
99+
{
100+
try {
101+
$issueService = new IssueService();
102+
103+
$worklog = $issueService->deleteWorklog($this->issueKey, $workLogid);
104+
105+
Dumper::dump($worklog);
106+
} catch (JiraException $e) {
107+
$this->assertTrue(false, 'testDeleteWorkLogById Failed : '.$e->getMessage());
108+
}
109+
}
94110
}

0 commit comments

Comments
 (0)