yandex / yandex_tracker_client

Python client for working with Yandex.Tracker Api
Other
59 stars 22 forks source link

How can I remove tag from queue? #9

Closed mashkay closed 1 year ago

mashkay commented 1 year ago

I need this request

POST /v2/queues/<queue-id>/tags/_remove
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth-токен>
X-Org-ID: <идентификатор организации>

{
    "tag": "<имя тега>"
}

this does not work because of wrong address

queue = client.queues[queue_name]
queue.perform_action("_remove", "post", {"tag":tag_name})

it uses

 /v2/queues/<queue-id>/_remove

instead of

 /v2/queues/<queue-id>/tags/_remove
Smosker commented 1 year ago

Hello! It looks like

queue.perform_action("/tags/_remove", "post", {"tag":tag_name})

should work

mashkay commented 1 year ago

I tried it before with "tags/_remove" It definitely send the request to the correct url but it rises an exeption for any post request with or without any data

Tracker errors: 400 {}
yandex_tracker_client.exceptions.BadRequest: Illegal parameter 

get request raises proper answer method not allowed exeption

"/tags/_remove" sends request to wrong url

 /v2/queues/<queue-id>//tags/_remove

mocking the YaTracker API with requests module works, but I hoped to use client

mashkay commented 1 year ago

I've got it

queue.perform_action("tags/_remove", "post", tag=tag_name)