jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

Jira Boards not found

Open cfoley220 opened this issue 1 year ago • 2 comments

Describe the bug

The JIRA CLI cannot location boards within my team project, despite directly querying the endpoint reveals there are boards.

Please provide following details

  1. JiraCLI Version:
Version="1.5.1", GitCommit="0e0f82d52ef5a775d2cc662fbe38d9732b9b5c59", CommitDate="2024-01-20T10:48:06+00:00", GoVersion="go1.21.5", Compiler="gc", Platform="darwin/amd64"
  1. Are you using Jira cloud or on-premise jira server?
SERVER INFO
-----------

Version:         8.21.1
Build Number:    821001
Deployment Type: Server
Default Locale:  
  1. What operating system are you using? Also mention version.
      System Version: macOS 14.6.1 (23G93)
      Kernel Version: Darwin 23.6.0

Sonoma is casual name.

  1. What terminal are you using? Also mention version.

MacOS built-in Terminal.

To Reproduce

Run init

jira setup --debug --installation local --server https://jira.robotics.a2z.com --login <LOGIN_REDACTED> --auth-type bearer --project COCO  --board "Movement CoCo Team"

The output, with some redacted information:

% jira setup --debug --installation local --server https://jira.robotics.a2z.com --login <LOGIN_REDACTED> --auth-type bearer --project COCO  --board "Movement CoCo Team"
Using config file: <PATH_REDACTED>
? Config already exist. Do you want to overwrite? Yes
â ¼ Verifying login details...

REQUEST DETAILS
------------------------------------------------------------

GET /rest/api/2/myself HTTP/1.1
Host: jira.robotics.a2z.com
Authorization: Bearer  <TOKEN>

â ¹ Fetching server details...

REQUEST DETAILS
------------------------------------------------------------

GET /rest/api/2/serverInfo HTTP/1.1
Host: jira.robotics.a2z.com
Authorization: Bearer  <TOKEN>

â ¼ Fetching projects...

REQUEST DETAILS
------------------------------------------------------------

GET /rest/api/2/project?expand=lead HTTP/1.1
Host: jira.robotics.a2z.com
Authorization: Bearer  <TOKEN>

â ‹ Fetching boards for project 'COCO'...

REQUEST DETAILS
------------------------------------------------------------

GET /rest/agile/1.0/board?projectKeyOrId=COCO HTTP/1.1
Host: jira.robotics.a2z.com
Authorization: Bearer <TOKEN>


✗ Unable to generate configuration: board not found
  Boards available for the project 'COCO' are 'None'

Within FireFox, I can directly open the page: https://jira.robotics.a2z.com/rest/agile/1.0/board?projectKeyOrId=COCO . The raw truncated data results are

{"maxResults":50,"startAt":0,"total":8,"isLast":true,"values":[...{"id":206,"self":"https://jira.robotics.a2z.com/rest/agile/1.0/board/206","name":"Movement CoCo Team","type":"scrum"},...]}

Expected behavior

The Jira CLI tool is able to display the various boards.

Additional context

cfoley220 avatar Sep 06 '24 17:09 cfoley220

This seems unusual. The API response seems fine. We're validating the board by its name internally so I was wondering if there could be an extra spaces, special characters, or something similar in the board name?

ankitpokhrel avatar Sep 17 '24 18:09 ankitpokhrel

Thanks Ankit

If I do not supply a board, the list of board available is None:

% jira setup --debug --installation local --server https://jira.robotics.a2z.com --login [email protected] --auth-type bearer --project COCO

...
? Default board:  [Use arrows to move, type to filter, ? for more help]
> None

This makes me believe the issue isn't specific to the board. For sanity, I also copied&pasted the board name directly from the output attained by visiting the endpoint in a browser

--

If I run jira init and chose None as my default board, I can then use the tool to list all boards in the project. This fails too:

% jira boards list
Error: invalid character '<' looking for beginning of value

cfoley220 avatar Sep 24 '24 13:09 cfoley220

I'm having a similar issue. For some reason, API requests that use projectKeyOrId return a smaller subset of results, whereas those that use the seemingly-undocumented project return all available results. In other words, query https://foobar.atlassian.net/rest/agile/1.0/board?projectKeyOrId=GOT yields:

  "maxResults": 50,
  "startAt": 0,
  "total": 34,
  "isLast": true,

whereas https://foobar.atlassian.net/rest/agile/1.0/board?project=GOT gives us:

  "maxResults": 50,
  "startAt": 0,
  "total": 88,
  "isLast": false,

I can offer no explanation for this behaviour, except it seems Jira wants us to use the former, even when boards that are clearly assigned to the project are omitted? If I change jira-cli to use the latter parameter, and add support for pagination, it seems to work just fine. I'd be happy to submit a PR if that was thought to be useful.

bas-ie avatar Aug 06 '25 23:08 bas-ie