Giter Club home page Giter Club logo

Comments (4)

cbruno10 avatar cbruno10 commented on June 21, 2024

@LalitTurbot If this table has a pagination issue, do others have the same issue as well?

from steampipe-plugin-jira.

LalitLab avatar LalitLab commented on June 21, 2024

@cbruno10 will verify other tables too for paging while working on fix for it

from steampipe-plugin-jira.

cbruno10 avatar cbruno10 commented on June 21, 2024

@LalitTurbot Thanks for looking into this issue earlier today. Based on our initial findings, there appear to be 2 blockers:

  • The users API doesn't return filtering fields in its responses, which makes implementing pagination client side difficult
  • When listing users with the maxResults (default 50) request parameter, the maximum value for that parameter is 1000

For the first issue, it seems like pagination isn't available for users in the Jira API. For instance, when attempting to get users from the API using curl:

curl --request GET \
  --url 'https://myjira-jira.atlassian.net/rest/api/2/users?startAt=0&maxResults=2' \  
  --user '[email protected]:...' \
  --header 'Accept: application/json'

The API returns the response:

[
  {
    "self": "https://myjira-jira.atlassian.net/rest/api/2/user?accountId=...",
    "displayName": "Lalit Bhardwaj",
    ...
  },
  {
    "self": "https://myjira-jira.atlassian.net/rest/api/2/user?accountId=...",
    "displayName": "Automation for Jira",
    ...
  }
]

This response is different from other APIs' responses in that it doesn't contain expected fields like startAt, total, or next, e.g.,

curl --request GET \
  --url 'https://myjira-jira.atlassian.net/rest/api/2/dashboard?startAt=0&maxResults=2' \
  --user '[email protected]:...' \
  --header 'Accept: application/json'
{
  "startAt": 0,
  "maxResults": 2,
  "total": 3,
  "next": "https://myjira-jira.atlassian.net/rest/api/2/dashboard?maxResults=2&startAt=2",
  "dashboards": [
    {
      "id": "10000",
      "isFavourite": false,
      "name": "Default dashboard",
      ...
    },
    {
      "id": "10001",
      "isFavourite": true,
      "name": "Lalit",
      ...
    }
  ]
}

These are the fields that allow us to implement paging client side, but unfortunately missing when listing users. This was mentioned in JRASERVER-65089.

For the second issue, we can use the maxResults request parameter, but that appears to be capped at 1000 users, so only 1000 users max would be returned. We're still currently doing some testing from our side, but if this is the case, then it could require another workaround from our side to ensure that we can retrieve all of the users.

from steampipe-plugin-jira.

tnelson-doghouse avatar tnelson-doghouse commented on June 21, 2024

For the record, I'm on Jira Cloud (and that JRASERVER-65089 bug is for Jira Server). Probably not helpful, but thought I'd mention it.

from steampipe-plugin-jira.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.