Trigger for status update to send a patch method in Azure DevOps - json

Have been working on the integration between Azure DevOps Services and ServiceNow. Our goal is to send Change Requests from ServiceNow to Azure DevOps, where they would become Features or User Stories. Whenever there is some update on Azure DevOps, that update should be sent to ServiceNow, and vice versa.
The idea is to work with REST API.
From our investigation, we have found that it is possible to send updates to other applications through Web Hooks. We are still not sure if this will suite our needs and if we are able to work with this. The problem is that the webhooks only support the HTTP method POST while Service Now requests PATCH to update on it’s side. Is this correct is there any way of creating webhooks with PATCH method?
Other way that we can integrate is to create some software that will send response needed. However, we cannot seem to find a way to automate this response. As I understood, it will generate response only when the script run, not when work item is updated. Is there any way to trigger the sending of a json file with all information within the work item whenever the work item state is updated?

As a workaround, you can try to create a custom service hook. Here is the document you can refer to .
Marketplace provides an extension(Azure DevOps Service Hooks DSL) . This extension framework is designed to ease the development of your own REST Web Hook web site to do this type of integration. It does this by providing a MVC WebAPI endpoint and a collection of helper methods, implemented as an extensible Domain Specific Language (DSL), for common processing steps and API operations such as calling back to the TFS/VSTS server that called the endpoint or accessing SMTP services.

Is there any way to trigger the sending of a json file with all
information within the work item whenever the work item state is
updated?
I am not sure if it is possible to trigger that.
But there is a ServiceNow DevOps extension for the integration between Azure Devops and Snow. You may use that.

Related

How to test WebHooks without an on-premise external system?

I'm trying to teach myself about integrating systems via WebHooks.
In a free/hosted GIS system, I can create a WebHook that would, in theory, POST a JSON object to an external system.
The problem is, I don't have an external system that's available right now for for receiving the POST.
I think I need some sort of publicly available sample server that would:
Receive the POST requests
Do something with the requests (ie. create some sort of record)
...so that I could determine if the WebHook worked correctly or not.
How can I test my WebHooks without having an on-premise external system?
I've poked around websites like Postman Echo and Amazon Lambda. But to my untrained eye, it seems like they're not quite designed for what I need.
You could use any of these options depending on your requirements:
You could use webhooks modules in services like Integromat or Zapier to receive webhook data and then apply transformation.
You could deploy a script on heroku and use the URL generated there to send the webhooks calls.
You could also use services like requestbin, webhook.site etc if you just want to receive webhooks data.
Regards

How to create a ServiceNow Change Request as a step in TFS 2018 Release

I am trying to create a ServiceNow Change Request as one of the steps in my Release. I was trying to Agentless Phase step (Invoke Rest API: Post).
I found one article online that suggested to create a Generic Endpoint for ServiceNow. I tried that in the step failed, I'm sure I don't have it set up correctly.
2019-11-12T12:55:28.8833838Z POST https://xyzhelpdesk.service-now.com/api/now/table/change_request
Response Code: 0
Response: An error was encountered while processing request.
Exception: {"error":{"message":"Exception while reading request","detail":"Cannot decode: java.io.StringReader#90f857"},"status":"failure"}
Exception Message: The remote server returned an error: (400) Bad Request. (type WebException)
The endpoint has a username and password defined, but I think in the setup for Step I may need more information in the Header section.
I can create the CR via a Powershell script, I guess I could just use that but Not sure the correct way to go.
Basically I want to create a ServiceNow CR as part of my deployment process. Then there is a TFS plugin gated step that will check the status on the CR and when it's approves the process moves forward.
Who has examples ?
Thanks
Actually there is a built-in extension-- ServiceNow Change Management which provide by Microsoft almost fit your needs.
It includes:
A release gate to hold the pipeline till the change management
process signals implementation for a change request. You can create a
new change request for every deployment or use an existing change
request.
An agentless task to update a change request during the deployment
process. It is typically used as the last task in the stage.
However, this extension works only with Azure DevOps Services and Azure DevOps Server 2019 Update 1 onwards.. Not available to use on tfs2018. You could consider to upgrade your TFS to latest Azure DevOps Version.
With TFS 2018, suggest you to use a powershell script to handle this. It's able to use
ServiceNow and Azure DevOps Rest API. You could also take a look at great article blogs(similar for TFS):
Integrating VSTS Release Management with ServiceNow using Deployment Gate for Change Management
Implement an Azure DevOps Release Gate to ServiceNow

How do i create api keys for users on my client instead of developer portal offered in azure api management?

I have an enpoint in my MERN app which I would like to expose to developers.
I came across APIM and would like to use it.
After going to the documentation I would like to know how do I can use APIM for my specific enpoint and where I allow users to generate API's in my client side react app.
I am also going through the API management API. but don't know how to generate user specific API keys...
You could simply mimic what the Developer Portal does using APIMs REST API.
If you are using the Consumption Tier of APIM, you can just create a standalone subscription using the Create or Update Subscription API. Yon don't have to set properties.ownerId in the request payload here.
On the other tiers, standalone subscriptions are not supported yet (but will be as mentioned in the official announcement blog under New Features), so you will have to create a user first using the Create or Update User API and then create a new subscription mentioning this user under properties.ownerId as /users/{userId}.
Since these REST APIs call the Azure Management API, you shouldn't be making these requests from the client and instead should be calling this from your backend.

Transform service types when using Bluemix Cloud Integration Service

I have been doing some research about the IBM Bluemix Cloud Integration Service and found the following links:
ftp://public.dhe.ibm.com/cloud/bluemix/cloudintegration/Cloud_Integration_for_Bluemix_User_Guide.pdf
https://www.ng.bluemix.net/docs/services/CloudIntegration/index.html
From what I have read, I have not been able to understand whether it is able to run some kind of "protocol transformation" or if it just publishes a REST or SOAP API.
I mean, imagine for example that I have a full backend publishing everything as SOAP services, but for some reason my apps only can get information through REST APIs. Does the basic connector o maybe the standard one make that kind of integration? Or do I need to put a third party product (or maybe even DataPower) to make that transformation?
Using the Cloud Integration service you can also create a REST API that links to an existing on-premises API (both SOAP and REST). Please take a look here: Creating a REST API that links to an existing on-premises API. You can upload a file that defines the on-premises API (WSDL or Swagger definition).
Please note that currently Cloud Integration cannot retrieve automatically that definition from your on-premises system. It has to be uploaded manually by the user.

Stubbing an API with Azure API Management

I was wondering if someone was able to provide some information regarding the Azure Management Portal. My question is whether the Portal can cater for stubbing APIs?
I have added an API via the Portal as well as some operations however, the documentation isn't clear whether the real API has to be published to Azure.. I was thinking I can add example requests and responses without a real API behind it, i.e. a stub?
You can add a stub easily enough. See the default 'echo' endpoint that comes with each new API that you add to API Management. Copy that pattern and you can build a stub. The API Management documention is some of the better content for Azure so I'd recommend reading it.