Skip to content

Board path format raises KeyError when attempting to find Board AgileResource #2407

@dawnkd

Description

@dawnkd

Bug summary

There is currently no method to get a board by id. To work around this I attempted to use the find method. However, the Board constructor sets its path to "board/{id}". This causes a KeyError to be raised when calling Board.find(<id>) or JIRA._find_for_resource(Board, <id>) when the find method attempts to format the path using self._resource.format(id).

Changing the path to "board/{0}" will fix this issue.

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

v10.3.13

jira-python version

3.10.5

Python Interpreter version

3.12.11

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Given a Jira client instance
jira: JIRA
# 2. When I call the function with argument x
jira._find_for_resource(Board, <id>)

Stack trace

...  
File "/home/vscode/.local/lib/python3.12/site-packages/jira/resources.py", line 263, in find
    path = self._resource.format(id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'id'

Expected behaviour

The Board resource should be found using the id and no KeyError should be raised

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions