I have created a Task in my Azure devops project. This Task has an excel file as an attachment. The excel file contains the list of users to be created along with the permission sets. My pipeline has code that reads the excel file and automates the user creation in the sales force org. I am currently stuck at a point wherein, my pipeline will be expecting this attachment in the work space during the execution.
Is there a way to fetch the attachment of a task in the VSTS pipeline via python? I did come across below API to fetch it:
However, I am not able to access this via python or post man. It keeps throwing me "Could not get any response".
Is there an easier way to feed the pipeline with the excel file that is present in the task?
You need first get a personal access token. You can create one for yourself following this documentation.
Then put you access token as password and Basic
as username (select type = Basic Auth)
You also need get your attachment id - you can use this url (after workitems you should put your workitem id)
https://dev.azure.com/<Your organization>/<Your project>/_apis/wit/workitems/<Work item it>?$expand=all&api-version=5.0
You will find your attachments in releations collection:
You can find this question also valuable