I’m trying to programmatically create a issue card in Azure boards using python script.
I’m using a PAT (personal access token)
`headers = base64encodedPAT
headers[Content-Type’]=’application/json-patch+json’
payload = dictionary_of_different_values_to_set
requesturl=f”https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/$Issue?api-version=7.0″
requestcall = requests.post(url=requesturl, headers=headers, data=bytes(json.dumps(payload),’utf-8′))
`
What did I try:
- When I run azure pipeline I get ‘Failed: 400 Bad Request’
- When I run it on rest api testing online I get ‘503 Service unavailable 0x80070057, Invalid request’
- I referred Microsoft website but not much details
- I saw a lot of Youtube videos which show creation of PAT but not on how to use it in pipeline. Not many videos on ‘Workitem’ apis
Please let me know what’s wrong in my approach, or throw some ideas or point me out to good online resources.
ProgrammerHGP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.