microsoft / microsoft/azure-devops-python-api
query_by_wiql throws exception
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 684
- Fork
- 218
- Merge medio
- 8g 10h
- PR unite (30g)
- 1
Descrizione
query_by_wiql throws exception:
'Unable to build a model: ("Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'", AttributeError("'str' object has no attribute 'get'")), DeserializationError: ("Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'", AttributeError("'str' object has no attribute 'get'"))', DeserializationError("Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'", AttributeError("'str' object has no attribute 'get'")))
I'm trying to get a list of backlog items ids using the following function:
def get_backlog_item_ids(self, project_name, item_type="Product Backlog Item"):
try:
work_item_tracking_client = self.connection.clients.get_work_item_tracking_client()
wiql_query = f"""
SELECT [System.Id]
FROM WorkItems
WHERE [System.TeamProject] = '{project_name}'
AND [System.WorkItemType] = '{item_type}'
ORDER BY [System.Id]
"""
query_result = work_item_tracking_client.query_by_wiql(wiql=wiql_query)
work_item_ids = [item.id for item in query_result.work_items]
print(f"Retrieved {len(work_item_ids)} backlog item IDs from project '{project_name}'.")
return work_item_ids
except Exception as e:
print(f"Error retrieving backlog item IDs: {str(e)}")
return []
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziate dal punto di ingresso query_by_wiql del client per il tracciamento dei work item e riproducete l’eccezione con il WIQL mostrato nell’issue. Verificate la forma prevista dell’argomento wiql e assicuratevi che la query restituisca gli ID dei work item senza un errore di deserializzazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, devops
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100