Currently, I am utilizing the DevOps restapi to retrieve certain information. The POST method is functioning perfectly for me.
However, when attempting to update the status of my work item using the PATCH method, it does not seem to be working and no error message is being returned.
function postApiData(ApiUrl, responseBody) {
var res = '';
try {
$.ajax({
type: 'POST',
async: false,
url: ApiUrl,
contentType: 'application/json',
data: JSON.stringify(responseBody),
cache: false,
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa("" + ":" + _token));
},
}).done(function (data) {
res = data;
}).fail(function (e) {
});
} catch (error) {
var x = error;
throw x;
}
return res;
};
When trying to utilize the Patch method, despite making necessary modifications, it continues to not display any errors or update my work item. Furthermore, I have verified that my access token is valid and has full permissions.
type: 'PATCH',
contentType: 'application/json-patch+json',