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

Priority is not integer #66

Open
omiderfanmanesh opened this issue Jan 8, 2024 · 2 comments
Open

Priority is not integer #66

omiderfanmanesh opened this issue Jan 8, 2024 · 2 comments

Comments

@omiderfanmanesh
Copy link

When I set Priority in Clickup dashboard (e.g. High), I get this error

Traceback (most recent call last):
  File "C:\PROJECT\Clickup\main.py", line 29, in main
    click_up_client.fetch_data()
  File "C:\PROJECT\Clickup\request_manager\clickup\client.py", line 40, in fetch_data
    tasks = c.get_tasks(self.list_id, include_closed=True)
  File "C:\Users\x\.conda\envs\general\lib\site-packages\clickupython\client.py", line 631, in get_tasks
    return models.Tasks.build_tasks(fetched_tasks)
  File "C:\Users\x\.conda\envs\general\lib\site-packages\clickupython\models.py", line 703, in build_tasks
    return Tasks(**self)
  File "pydantic\main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Tasks
tasks -> 2 -> priority
  value is not a valid integer (type=type_error.integer)

This is a part of the result as json from postman and clickup api

          "watchers": [],
            "checklists": [],
            "tags": [],
            "parent": null,
            "priority": {
                "color": "#f8ae00",
                "id": "2",
                "orderindex": "2",
                "priority": "high"
            },

as you see, the Priority is a JSON object, not an int.

So what is the solution?

@Tianqi-Dotes
Copy link

Got the same issue here.
image

@nikpelgr
Copy link

Had the same issue. Needed to work on the client.py and models.py and did the following changes manually on my venv:

  1. in client.py, replaced all 'priority: int = None' to 'priority: str = None' and 'priority: int' to 'priority: str'
  2. in models.py, replaced the 'priority: Any = None' to 'priority: str = None', 'priority: Any' to 'priority: str' and in the Task Class 'priority: Optional[Any] = None' to 'priority: Optional[Priority] = None'

In my program I had to update the code to use the objects correctly and now I have a syncer that gets tasks from Jira down to Clickup without any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants