Azure Devops Releases Pre-deployment comment edit - azure-devops

I have a lot of releases and there are pre-deployment approver. Approver writes comment before approve and I want to edit old comment. Is this possible ?

I do not think this is possible, either via the interface or via the API, the idea being that an approval for a release should be an immutable record of that event.
If you try and update an 'approved' approval via the REST API, you will get the relevant exception:
Request
PATCH https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/approvals/{approvalId}?api-version=5.0-preview.3
{
"status": "approved",
"comments": "Change comment"
}
Response
{
"$id": "1",
"innerException": null,
"message": "Approval(s) {approvalId} are not in a pending state. Only pending approval(s) can be updated. Please refresh the release and provide pending approvals.",
"typeName": "Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException, Microsoft.VisualStudio.Services.ReleaseManagement2.Data",
"typeKey": "InvalidRequestException",
"errorCode": 0,
"eventId": 3000
}
If you have a situation whereby something offensive or inappropriate has been written into these comments in your organisation you could try to delete the release entirely or contact Azure DevOps support.

Related

Is it possible to set out user status message in teams through graph API?

I want to set user status message in teams using graph api and I saw this code but it's not working for me is there any solution that could help??
"#odata. context":"https://graph.mic.."
"id": "f599db41-7474-416a-acb1-88f9e
"availability": "Available"
"activity" :"Available"
"outofOfficeSettings": {"message": "oof mes"
"is0utofoffice":true }
Note: the availability & activity is working and has been updating in teams but the part below is not working for me""
or is there any way using graph api that I could set teams status message from bambooHR direct to teams?
You cannot set out of office user presence through graph API. As of now, only the parameters mentioned below are supported in the body of setPresence call
POST https://graph.microsoft.com/beta/users/object_id_of_user/presence/setPresence
Also, this call is supported under Application context only and not under user context.
sessionId
availability
activity
expirationDuration
However, you can view the out of office user presence via graph API by using below call:
GET https://graph.microsoft.com/beta/me/presence
or
GET https://graph.microsoft.com/beta/users/object_id_of_user/presence
{
"id": "fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"availability": "Available",
"activity": "Available",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
}
}
Ref Doc:
https://learn.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-beta&tabs=http
https://learn.microsoft.com/en-us/graph/api/presence-setpresence?view=graph-rest-beta&tabs=http
If you wish you may vote for this feature on Microsoft Teams · Community

Get GitHub security alerts through notification API

I want to get GitHub notifications about a given repo’s Security alerts through the notification API, and I would like to know the JSON returned by this API.
Let say for a given repo I subscribed to the Release and Security alerts in GitHub UI:
When I publish a “Security advisory” on a given repo, I don’t receive any notification with the others account subscribed to this repo. I think this is because GitHub needs to validate this security advisory before it sends the notifications events.
So can someone please give me an example of JSON returned by the notification API for a Security event ?
Here is an example of JSON returned by the notification API for the Release events (as I can generate some by myself):
curl -su <me>:<token> https://api.github.com/notifications
[
{
"id": "3267365319",
"unread": false,
"reason": "subscribed",
"updated_at": "2022-03-14T16:07:41Z",
"last_read_at": null,
"subject": {
"title": "0.5.0",
"url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"latest_comment_url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"type": "Release"
},
"repository": {
...
I’m looking for the same kind of JSON, but for the Security events.

Hot to create new channel in Teams that is not hidden, using GraphAPI

I have an app that uses microsoft's graphAPI to create channels in my organizations Team dynamically. All is well and I can create the channels, except the channels I'm creating are marked as hidden - users need to manually "show" the channel before reading messages or even get notifications.
Is there any way to bypass this "hidden" thing? Can i force the created channels to be visible for every user in the team, without the approving them first.
In theory, this function is controlled by isFavoriteByDefault, and when setting it to true, the channel should automatically be marked 'favorite' for all members of the team.
Unfortunately, after doing some research and test, I find that this property can't be changed through Graph API. So currently we can't bypass the "hidden" thing.
A similar post: Microsoft graph BETA add Microsoft Teams channel with isfavoritebydefault. The Microsoft engineer mentioned that could be they didn't fix the path POST /teams/id/channels.
I was able to add this but I see some inconsistency in the responses. For example if i run a flow that does the graph api process to create a channel within a team it only sets the show under channels for my account not the rest of the users associated with it. I don't know if anyone else has experienced this or has a fix.
Here is my sample:
{
"requests": [
{
"url": "/teams/{varTeamID}/channels",
"method": "POST",
"id": 1,
"headers": {
"Content-Type": "application/json"
},
"body": {
"displayName": "{varChannelName}",
"description": "This channel is in existence for",
"isFavoriteByDefault": true
}
}
]
}

Unable to get Azure DevOps events through REST API

I am trying to get Azure DevOps events through REST API listed below:
POST https://dev.azure.com/{organization}/_apis/notification/events?api-version=5.0-preview.1
I tried the above API to get events but in postman call, I am getting below response:
{
"$id": "1",
"innerException": null,
"message": "The feature is disabled. Contact your Azure DevOps Server administrator.",
"typeName": "Microsoft.TeamFoundation.Framework.Server.FeatureDisabledException, Microsoft.TeamFoundation.Framework.Server",
"typeKey": "FeatureDisabledException",
"errorCode": 0,
"eventId": 3000
}
It should give events after postman call
Your method with POST is for publish a new event: Events - Publish Event. I can not find the get method for events (only: Event Types - Get or Event Types - List). Maybe it was not coded yet:

all_trips Webhooks: Find out which user the status_changed is for

I've got the Webhooks working for our developer accounts, and it emits a status_changed message every time there is an Uber request, even if the request was not initiated from our app (using the "all_trips" permission)
When we get the response back, how do we determine which user this is for? E.g. in the response below, there is no way to determine that and using the server token to authenticate to the resource_href gives an "Invalid OAuth 2.0 credentials provided" error.
{
"event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0777",
"event_time": 1427343990,
"event_type": "all_trips.status_changed",
"meta": {
"resource_id": "2a2f3da4",
"resource_type": "request",
"status": "accepted"
},
"resource_href": "https://api.uber.com/v1/requests/2a2f3da4"
}
Thanks for catching this! We rolled out a fix that adds the users UUID as an additional field in the "meta" section, as well as updated our documentation here: https://developer.uber.com/docs/webhooks
Let us know if you have any more trouble!