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:
Attachments - Get
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
Related
I'm wanting to create an intake form that will create a new work item on a Azure DevOps board. Right now I've got a Microsoft Forms form create and have lightly tweaked the pre-made Power Automate script that is provided for this purpose.
Right now when somebody submits the form a new work item is created with a few text variables from the form incorporated into it and an email is sent to the requestor letting them know the form was submitted.
There's a few features that I want to incorporate but haven't figured out yet:
Provide a way for the requestor to attach files to the form and have them appear as attachments in the ADO work item. Such as if there is already some documentation for what is being requested that the implementing team would benefit from having.
Include the work item ID from ADO in the email confirmation that is sent back to the requestor.
Provide a way for the requestor to check on the status of the work item after they have submitted the request.
Can these things be done using Microsoft Forms > Power Automate > Azure DevOps? If not does anybody have a better solution for creating an intake process that ultimately creates a new item in ADO? Thanks!
I want to create chrome extension, which interacts with github repository.
1: User click button
2: API creates new file and inserts submitted data
3: API reads all existing files and calculates specific data
4: API sends back calculations to user
(All commands launched automatic from extension)
Can someone explain:
If it's possible to use Personal access tokens from github, but also lock access for outsiders?
I mean.. token can be visible for everyone, but Github-API should work only if used with chrome extension.
At this moment completed only two steps..
Created 'machine user'
Invited him to my repository and gave 'repo' permissions
Next steps unknown..
?? Create Personal access tokens or OAuth apps to get access to API?
?? Somehow give info to github about my extension, and allow all actions only from this extension
I am trying to download a blobbed zip for a repository on the Azure DevOps Server 2019 API using the following documentation.
https://learn.microsoft.com/en-us/rest/api/azure/devops/git/blobs/get%20blobs%20zip?view=azure-devops-server-rest-5.0
The request body is supposed to contain:
REQUEST BODY
Name Type Description
body string[] Blob IDs (SHA1 hashes) to be returned in the zip file.
How can I obtain the blob ids?
How can I obtain the blob ids?
You can try Items-List api to obtain the blob ids:
GET https://{instance}/{collection}/{project}/_apis/git/repositories/{repositoryId}/items?recursionLevel=Full&api-version=5.0
The response:
Also, if you're trying to get the IDs programatically, you can use GitHttpClientBase.GetItemsAsync Method
.
Ps: As Daniel commented above, it's more recommended to use git command to download whole repository. So you can also try to call git-related api in your code if you want to do that programatically. There're many discussions online about this topic, like this.(Since it's not your original question about Blobids, I won't talk too much here.)
I have been working for a project that makes use of google-APIs to create/write and read google sheets. I also wanted to duplicate a template on every user onboard.
I'm trying to use Files.Copy API, but I'm unable to do so with the Google API Key. It always restricts the copy with an error message ''This error may be due to using an insufficient credential type. Try using OAuth 2.0."
Is there any way to copy the google sheet using only API key other than OAuth?
Here are the steps that I followed to overcome this issue.
Create a folder in GSuite drive
Share the folder with the service account
Move the template sheet that needs to be copied to the shared folder
Share the template key with the service account
User File.Copy (Drive API) to copy the template sheet to the shard folder itself.
This way you can achieve both copying a template and viewing it. Without a shared folder, it ain't possible to view the sheets created by a service account
Previously I wasn't able to copy the sheet because it was owned by another user and had to get the consent from the user through oAuth. Now its resolved by sharing the parent folder of the template with the service account email.
I was using the following SO post to create a folder in a SharePoint list: Here
It kinda-sorta works, but not as expected. Here is the way the logic works:
A Policy is either new or has been updated in our Document Library,
which acts as my trigger for Logic Apps
The condition then looks forthe word "Policy" in the File Identifier
It then goes and creates a folder in another SharePoint list (Policy Acknowledgement), based on the filename/Policy Name
Then it sends an email to staff advising them that a new/updated policy is available to read, which then has another link that says "I agree, etc"
This then writes to the Policy Acknowledgement list that the user has read the document
So all steps seem to work, except for when I go to view the Policy Acknowledgement list, the new folder created for that Policy doesn't display in the list. However, if I type in the address to the list/folder, I can view it. Here are my steps, below:
Create the folder
Send the email
Acknowledge the Policy
List where the new folder should be created - But doesn't (the other 3 folders were manually created for testing purposes)
Here is the actual folder, once the direct URL is typed-in
Although the folder isn't listed in SP, it still appears in Logic Apps as an actual folder
This isn't an issue for me, as I can always type in the address manually to get to the Policy Folder. But this is meant to be for our HR team, who just want to be able to open the "Policy Acknowledgement" list, and view all the Policy Folders in there.
I am starting to look down the path of creating a PowerShell runbook, that creates the folder for me, if that is the last resort (or should it have been my first resort?).