Skip to content

Issue with Json response parsing, passing string to AtlassianDocumentFormat constructor. #84

Description

@Luke-Arch
JiraCloud\ADF\AtlassianDocumentFormat::__construct(): Argument #1 ($document) must be of type DH\Adf\Node\Block\Document|DH\Adf\Node\Node, string given, called in /var/www/html/vendor/netresearch/jsonmapper/src/JsonMapper.php on line  
   706

Thrown by implementation, on line 9 below (getBoardIssues call). Which appears to happen when parsing a multiline description field, when fetching board issues.

        $projectService = new ProjectService();
        $p = $projectService->get('TEST');

        //Get project boards
        $boardsService = new BoardService();
        $bs = $boardsService->getBoardList(['projectKeyOrId' => $p->id]);

        foreach ($bs as $b) {
            $issues = $boardsService->getBoardIssues($b->id, [
                'maxResults' => 10,
            ]);

            $data = [];

            foreach ($issues as $issue) {
                $data[] = [
                    'id' => $issue->id,
                    'key' => $issue->key,
                    'name' => $issue->fields->summary,
                    'description' => $issue->fields->description,
                ];
            }
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions