How to add task to an Agile board via the API Jetbrains Created May 18, 2023 12:47 How do I add a task to a specific Agile Board via the REST API?
Hi!
You need to use the command add board <boardname>.
This worked. Here's the python function I created:
def set_task_board(task_key, board):
headers_txt = json.loads('{"Accept": "application/json","Authorization"' + ': "' + yp.YOUTRACK_TOKEN + '","Content-Type": "application/json"}')
json_txt = {"query": "add Board " + board,"issues": [{"idReadable": task_key}]}
response = requests.post(command_txt, headers=headers_txt, json=json_txt)
if response.status_code == 200:
print(f"Task {task_key} added to board {board}")