GET /rulesets doesn't work properly in some cases

Hello, I am working on PagerDuty integration and I run into a very specific bug.
I have a PagerDuty user who has exactly one ruleset - Default Global Ruleset
When I try to fetch this user’s rulesets using GET /rulesets endpoint, it returns me a response without any rulesets, which is not correct because this user has this Default Global Ruleset.

Here is a response example:
{ "limit": 25, "more": false, "offset": 0, "rulesets": [], "total": 0 }

When I create a second ruleset, endpoint GET /rulesets returns correctly both rulesets - the newly created one and the default one. When I then delete the newly created ruleset user now has just that default one. However, when I now try to call this endpoint GET /rulesets it returns me this default ruleset. It seems to me that this behavior is not intended and could be considered a bug.
Can someone help me with this?

Hi Haiko,

I have attempted to replicate this instance from my end and for both instances with having an event ruleset added to the account and when there was only one Default Global event Rules, they had both returned with the expected responses you were trying to retrieve.

I tested on an account that has no event rulesets added (other than default global ruleset)

{
  "limit": 25,
  "more": false,
  "offset": 0,
  "rulesets": [
    {
      "created_at": "2021-08-06T13:31:09Z",
      "creator": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      },
      "id": "XXXXXXXX",
      "name": "Default Global",
      "routing_keys": [
        "XXXXXX"
      ],
      "self": "https://api.pagerduty.com/rulesets/XXXXXXX",
      "team": null,
      "type": "default_global",
      "updated_at": "2021-08-06T13:31:09Z",
      "updater": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      }
    }
  ],
  "total": 1
}

I have tested on an account that had one ruleset added (and default global ruleset) and returns 2 total results:

{
  "limit": 25,
  "more": false,
  "offset": 0,
  "rulesets": [
    {
      "created_at": "2021-06-22T12:55:00Z",
      "creator": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      },
      "id": "XXXXXXXXXXXX",
      "name": "Event Intelligence Example",
      "routing_keys": [
        "XXXXXXXX"
      ],
      "self": "https://api.pagerduty.com/rulesets/XXXXXXX",
      "team": null,
      "type": "global",
      "updated_at": "2021-07-20T17:15:54Z",
      "updater": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      }
    },
    {
      "created_at": "2021-08-06T13:02:53Z",
      "creator": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      },
      "id": "XXXXXXXXXXXXXXX",
      "name": "Default Global",
      "routing_keys": [
        "XXXXXXXXXXXXXXXX"
      ],
      "self": "https://api.pagerduty.com/rulesets/XXXXXXXXXXXXXXXX",
      "team": null,
      "type": "default_global",
      "updated_at": "2021-08-06T13:02:53Z",
      "updater": {
        "id": "XXXXXXX",
        "self": "https://api.pagerduty.com/users/XXXXXXX",
        "type": "user_reference"
      }
    }
  ],
  "total": 2
}

Without more information of how the logging works and if it captures the response size and response payload we wont know exactly what criteria that caused the results to be returned blank.

In order to help you troubleshoot your API call without revealing sensitive information in this thread, please reach out to support@pagerduty.com and reference this post. We’d be happy to help look into this further.

Let me know if you have any other questions.

Best Regards,
Power
Technical Support Specialist

Hi Haiko,

Thank you for providing a walkthrough of the steps you did to recreate this error you receive from your API call.

Can you please delete your previous reply as it contains sensitive information containing about your Pagerduty instance?

In order to troubleshoot this into more detail, we will need to move this conversation over to a ticket to support@pagerduty.com and reference this post.
I will be happy to help you with this further.

Best Regards,
Power
Technical Support Specialist

Hello,

Thank you for your support. I have deleted my reply. I have sent you an email to support@pagerduty.com.

Thanks again.