How to add task to an Agile board via the API

How do I add a task to a specific Agile Board via the REST API? 

0
2 comments

Hi!

You need to use the command add board <boardname>.

0

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}")

0

Please sign in to leave a comment.