Skip to content

Commit 0fb80e3

Browse files
authored
changed example to adf-tool
1 parent afbf60f commit 0fb80e3

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,12 @@ try {
739739

740740
$issueFieldTwo = new IssueField();
741741

742-
$desc2 = new AtlassianDocumentFormat();
743-
744-
$desc2->addParagraph('Full description for second issue ');
742+
$doc2 = (new Document())
743+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
744+
->text('Full description for second issue ') // simple unstyled text
745+
->end() // closes `paragraph` node
746+
747+
$desc2 = new AtlassianDocumentFormat(doc2);
745748

746749
$issueFieldTwo->setProjectKey('TEST')
747750
->setSummary('something else is wrong')
@@ -786,9 +789,11 @@ use JiraCloud\ADF\AtlassianDocumentFormat;
786789
try {
787790
$issueField = new IssueField();
788791

789-
$descV3 = new AtlassianDocumentFormat();
790-
791-
$descV3->addParagraph('Full description for issue ');
792+
$doc = (new Document())
793+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
794+
->text('Full description for sub-task issue ') // simple unstyled text
795+
->end() // closes `paragraph` node
796+
$descV3 = new AtlassianDocumentFormat(doc);
792797

793798
$issueField->setProjectKey('TEST')
794799
->setSummary('something's wrong')
@@ -939,8 +944,13 @@ $issueKey = 'TEST-879';
939944
try {
940945
$issueField = new IssueField(true);
941946

942-
$descV3 = new AtlassianDocumentFormat();
943-
$descV3->addParagraph('This is a shorthand for a set operation on the summary field');
947+
$doc = (new Document())
948+
->paragraph() // paragraph, can have child blocks (needs to be closed with `->end()`)
949+
->text('This is a shorthand for a set operation on the summary field ') // simple unstyled text
950+
->end() // closes `paragraph` node
951+
;
952+
953+
$descV3 = new AtlassianDocumentFormat(doc);
944954

945955
$issueField->setAssigneeNameAsString('admin')
946956
->setPriorityNameAsString('Blocker')

0 commit comments

Comments
 (0)