You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-56Lines changed: 74 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1660,12 +1660,17 @@ try {
1660
1660
1661
1661
#### Add worklog in issue
1662
1662
1663
-
[See Jira API V2 reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addWorklog)
1663
+
[See Jira API reference](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-post)
1664
1664
1665
1665
```php
1666
1666
<?php
1667
1667
require 'vendor/autoload.php';
1668
1668
1669
+
use DateInterval;
1670
+
use DateTime;
1671
+
use DH\Adf\Node\Block\Document;
1672
+
use JiraCloud\ADF\AtlassianDocumentFormat;
1673
+
use PHPUnit\Framework\TestCase;
1669
1674
use JiraCloud\Issue\IssueService;
1670
1675
use JiraCloud\Issue\Worklog;
1671
1676
use JiraCloud\JiraException;
@@ -1674,58 +1679,42 @@ $issueKey = 'TEST-961';
1674
1679
1675
1680
try {
1676
1681
$workLog = new Worklog();
1682
+
1683
+
$doc = (new Document())
1684
+
->heading(1) // header level 1, can have child blocks (needs to be closed with `->end()`)
1685
+
->text('h1') // simple unstyled text, cannot have child blocks (no `->end()` needed)
1686
+
->end() // closes `heading` node
1687
+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
1688
+
->text('we’re ') // simple unstyled text
1689
+
->strong('support') // text node embedding a `strong` mark
1690
+
->text(' ') // simple unstyled text
1691
+
->em('markdown') // text node embedding a `em` mark
1692
+
->text('. ') // simple unstyled text
1693
+
->underline('like') // text node embedding a `underline` mark
1694
+
->text(' this.') // simple unstyled text
1695
+
->end() // closes `paragraph` node
1696
+
->heading(2) // header level 2
1697
+
->text('h2') // simple unstyled text
1698
+
->end() // closes `heading` node
1699
+
->heading(3)
1700
+
->text('heading 3')
1701
+
->end()
1702
+
->paragraph() // paragraph
1703
+
->text('also support heading.') // simple unstyled text
[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-updateWorklog)
1734
+
[See Jira API reference](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-id-put)
1747
1735
1748
1736
```php
1749
1737
<?php
1750
1738
require 'vendor/autoload.php';
1751
1739
1740
+
use DateInterval;
1741
+
use DateTime;
1742
+
use DH\Adf\Node\Block\Document;
1743
+
use JiraCloud\ADF\AtlassianDocumentFormat;
1744
+
use PHPUnit\Framework\TestCase;
1752
1745
use JiraCloud\Issue\IssueService;
1753
1746
use JiraCloud\Issue\Worklog;
1754
1747
use JiraCloud\JiraException;
@@ -1759,9 +1752,34 @@ $workLogid = '12345';
1759
1752
try {
1760
1753
$workLog = new Worklog();
1761
1754
1762
-
$workLog->setComment('I did edit previous worklog here.')
1763
-
->setStarted('2016-05-29 13:15:34')
1764
-
->setTimeSpent('3d 4h 5m');
1755
+
$doc = (new Document())
1756
+
->heading(1) // header level 1, can have child blocks (needs to be closed with `->end()`)
1757
+
->text('h1') // simple unstyled text, cannot have child blocks (no `->end()` needed)
1758
+
->end() // closes `heading` node
1759
+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
1760
+
->text('I’did ') // simple unstyled text
1761
+
->strong('edit') // text node embedding a `strong` mark
1762
+
->text(' ') // simple unstyled text
1763
+
->em('previous') // text node embedding a `em` mark
1764
+
->text(' ') // simple unstyled text
1765
+
->underline('worklog') // text node embedding a `underline` mark
1766
+
->text(' here.') // simple unstyled text
1767
+
->end() // closes `paragraph` node
1768
+
->heading(2) // header level 2
1769
+
->text('h2') // simple unstyled text
1770
+
->end() // closes `heading` node
1771
+
->heading(3)
1772
+
->text('heading 3')
1773
+
->end()
1774
+
->paragraph() // paragraph
1775
+
->text('also support heading.') // simple unstyled text
1776
+
->end() // closes `paragraph` node
1777
+
;
1778
+
1779
+
$comment = new AtlassianDocumentFormat($doc);
1780
+
1781
+
$workLog->setComment($comment)
1782
+
->setTimeSpent('2d 7h 5m');
1765
1783
1766
1784
$issueService = new IssueService();
1767
1785
@@ -1776,9 +1794,9 @@ try {
1776
1794
1777
1795
#### Get issue worklog
1778
1796
1779
-
[See Jira API reference (get full issue worklog)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssueWorklog)
1797
+
[See Jira API reference (get full issue worklog)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-get)
1780
1798
1781
-
[See Jira API reference (get worklog by id)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getWorklog)
1799
+
[See Jira API reference (get worklog by id)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-worklog-list-post)
0 commit comments