Skip to content

AtlassianDocumentFormat: Call to a member function jsonSerialize() on null #86

@bkdotcom

Description

@bkdotcom

getWorklogById is creating a worklog with a comment JiraCloud\ADF\AtlassianDocumentFormat that has null for the document value... which leads to

    public function jsonSerialize(): array
    {
        return $this->document->jsonSerialize(); // Call to a member function jsonSerialize() on null
    }

when trying to edit the worklog

JsonMapper is creating the AtlassianDocumentFormat instance via $reflectClass->newInstanceWithoutConstructor(); (so the document property is never set)

the getworklogbyid response:

{
   "self": "redacted",
   "author": {
      "self": "redacted",
      "accountId": "redacted",
      "emailAddress": "redacted",
      "avatarUrls": {
         "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/48",
         "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/24",
         "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/16",
         "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/32"
      },
      "displayName": "Bradley Kent",
      "active": true,
      "timeZone": "America/Chicago",
      "accountType": "atlassian"
   },
   "updateAuthor": {
      "self": "redacted",
      "accountId": "redacted",
      "emailAddress": "redacted",
      "avatarUrls": {
         "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/48",
         "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/24",
         "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/16",
         "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:48a254ec-e04b-468c-9e13-39a01580f1e4/96feff35-6cef-40da-9afd-811aee568951/32"
      },
      "displayName": "Bradley Kent",
      "active": true,
      "timeZone": "America/Chicago",
      "accountType": "atlassian"
   },
   "comment": {
      "type": "doc",
      "version": 1,
      "content": []
   },
   "created": "2024-07-15T15:50:17.465-0400",
   "updated": "2024-07-15T15:50:39.351-0400",
   "started": "2024-07-12T11:30:00.000-0400",
   "timeSpent": "30m",
   "timeSpentSeconds": 1800,
   "id": "405670",
   "issueId": "209253"
}

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