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

[REST API] Label information not included, if single stack is requested. #5962

Open
nikhub opened this issue Jun 2, 2024 · 0 comments
Open

Comments

@nikhub
Copy link

nikhub commented Jun 2, 2024

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Describe the bug
If all stacks of a board are requested via REST API (GET /boards/{boardId}/stacks), the label information of all cards is included in the response for all stacks.

Example: This is the JSON response of a test board with only one stack and two cards, the second one containing a label.

[
   {
      "id":24,
      "title":"TestStack",
      "boardId":7,
      "deletedAt":0,
      "lastModified":1717319772,
      "cards":[
         {
            "id":833,
            "title":"TestCard1",
            "description":"",
            "stackId":24,
            "type":"plain",
            "lastModified":1717319754,
            "lastEditor":null,
            "createdAt":1717194622,
            "labels":[
               
            ],
            "assignedUsers":[
               
            ],
            "attachments":null,
            "attachmentCount":0,
            "owner":{
               "primaryKey":"Tester",
               "uid":"Tester",
               "displayname":"Max Mustermann",
               "type":0
            },
            "order":999,
            "archived":false,
            "done":null,
            "duedate":null,
            "deletedAt":0,
            "commentsUnread":0,
            "commentsCount":0,
            "ETag":"2ce44df456088877165c8ffb445da29a",
            "overdue":0
         },
         {
            "id":834,
            "title":"TestCard2",
            "description":"",
            "stackId":24,
            "type":"plain",
            "lastModified":1717319772,
            "lastEditor":null,
            "createdAt":1717194626,
            "labels":[
               {
                  "id":187,
                  "title":"TestTag",
                  "color":"c4be27",
                  "boardId":7,
                  "cardId":834,
                  "lastModified":0,
                  "ETag":"cfcd208495d565ef66e7dff9f98764da"
               }
            ],
            "assignedUsers":[
               
            ],
            "attachments":null,
            "attachmentCount":0,
            "owner":{
               "primaryKey":"Tester",
               "uid":"Tester",
               "displayname":"Max Mustermann",
               "type":0
            },
            "order":999,
            "archived":false,
            "done":null,
            "duedate":null,
            "deletedAt":0,
            "commentsUnread":0,
            "commentsCount":0,
            "ETag":"203884e255b00b4169807fb0baa3837f",
            "overdue":0
         }
      ],
      "order":999,
      "ETag":"203884e255b00b4169807fb0baa3837f"
   }
]

But if information of an individual stack of a board is requested via REST API (GET /boards/{boardId}/stacks/{stackId}), the label information of the cards is missing in the JSON response. The field of the labels is "null.

This is the JSON response for the same stack, requested for the stack individually:

{
   "id":24,
   "title":"TestStack",
   "boardId":7,
   "deletedAt":0,
   "lastModified":1717319772,
   "cards":[
      {
         "id":833,
         "title":"TestCard1",
         "description":"",
         "stackId":24,
         "type":"plain",
         "lastModified":1717319754,
         "lastEditor":null,
         "createdAt":1717194622,
         "labels":null,
         "assignedUsers":[
            
         ],
         "attachments":null,
         "attachmentCount":0,
         "owner":"Tester",
         "order":999,
         "archived":false,
         "done":null,
         "duedate":null,
         "deletedAt":0,
         "commentsUnread":0,
         "commentsCount":0,
         "ETag":"2ce44df456088877165c8ffb445da29a",
         "overdue":0
      },
      {
         "id":834,
         "title":"TestCard2",
         "description":"",
         "stackId":24,
         "type":"plain",
         "lastModified":1717319772,
         "lastEditor":null,
         "createdAt":1717194626,
         "labels":null,
         "assignedUsers":[
            
         ],
         "attachments":null,
         "attachmentCount":0,
         "owner":"Tester",
         "order":999,
         "archived":false,
         "done":null,
         "duedate":null,
         "deletedAt":0,
         "commentsUnread":0,
         "commentsCount":0,
         "ETag":"203884e255b00b4169807fb0baa3837f",
         "overdue":0
      }
   ],
   "order":999,
   "ETag":"203884e255b00b4169807fb0baa3837f"
}

To Reproduce
Steps to reproduce the behavior:

  1. Set up a Nextcloud Deck board with a stack containing a card with a label
  2. curl -X GET 'https://<username>:<password>@<NextcloudIPorURL>/index.php/apps/deck/api/v1.1/boards/' -H 'Accept: application/json' -H 'OCS-APIRequest: true' -H 'Content-Type: application/json;charset=utf-8'
  3. Check, if label is included in the response
  4. curl -X GET 'https://<username>:<password>@<NextcloudIPorURL>/index.php/apps/deck/api/v1.1/boards/<boardID>/stacks/<stackID>' -H 'Accept: application/json' -H 'OCS-APIRequest: true' -H 'Content-Type: application/json;charset=utf-8'
  5. Check, if label is not included in the response.

Expected behavior
In case the data of an individual stack is requested, the label information should be included in the JSON resonse.

Client details:

  • OS: iOS and macOS
  • Version: iOS 17, macOS 14
  • Device: iPhone Xs, iPhone 15 Simulator, macBook Air M1
@nikhub nikhub changed the title [REST API] [REST API] Label information not included, if information of a single single stack is requested. Jun 2, 2024
@nikhub nikhub changed the title [REST API] Label information not included, if information of a single single stack is requested. [REST API] Label information not included, if single stack is requested. Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants