Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bkdotcom opened this issue Jul 19, 2024 · 0 comments

Comments

@bkdotcom
Copy link

bkdotcom commented Jul 19, 2024

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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant