Access Task Desc via API

I’m trying to access the Tasks Description field via the API. I managed to get it to work for Epics but not Tasks.

Query Epic descriptions from Epics board

if epic_ids:desc_query = f’‘’query {{boards(ids: [{epics_board_id}]) {{items_page(query_params: {{ids: [{', '.join(epic_ids)}]}}) {{items {{iddescription {{blocks {{content}}}}}}}}}}}}

To access the “Description” field for tasks via the monday API, you need to ensure that your query is correctly structured and that you’re targeting the right board and item IDs. Since you mentioned that it works for Epics but not for Tasks, here are some steps to troubleshoot and resolve the issue:

  1. Verify Board and Item IDs:

    • Ensure that you have the correct board ID for the Tasks board.

    • Double-check that the item IDs you are querying belong to the Tasks board.

  2. Check Field Accessibility:

    • Confirm that the “Description” field exists for the tasks and is accessible via the API. The field might be named differently or not be available for the tasks.
  3. Review API Query Structure:

    • Make sure your query is correctly structured to access the “Description” field. Here’s a general guide on how you might structure the query:
python
task_ids = [...]  # List of task IDs you want to query
tasks_board_id = ...  # Your Tasks board ID

desc_query = f'''
query {{
  boards(ids: [{tasks_board_id}]) {{
    items(ids: [{', '.join(map(str, task_ids))}]) {{
      id
      name
      column_values(ids: "description") {{
        text
      }}
    }}
  }}
}}
'''
  1. Check Column ID:

    • The column ID for the description might not be “description.” Use the API to list all columns in the board to verify the correct column ID for the description field.
  2. Test with a Single Task:

    • Try running the query for a single task ID to see if it returns the expected results. This can help isolate whether the issue is with specific tasks or the query itself.
  3. Error Handling:

    • Implement error handling in your script to catch any issues with the API request, such as invalid IDs or permission errors.

If you continue to experience issues, consider reaching out to monday. com support for more detailed assistance, as they can provide insights specific to your account and data setup.