Hi @oussouss, you can add button as suggested by @domliu and @saudali_25. I will try to provide the javascript functions.
1. Add button to the form directly or using JavaScript.
<button type="button" id = "InProgressStatus" class="btn-custom btn btn-default" onclick="UpdateCase('In-Progress')">In-Progress</button>
<button type="button" id = "ResolvedStatus" class="btn-custom btn btn-default" onclick="UpdateCase('Resolved')">Resolved</button>
2. Add the webapi helper functions along with our custom function to the form.
$(function () {
// #region Webapi methods
// Web API ajax wrapper
(function (webapi, $) {
function safeAjax(ajaxOptions) {
var deferredAjax = $.Deferred();
shell
.getTokenDeferred()
.done(function (token) {
// Add headers for ajax
if (!ajaxOptions.headers) {
$.extend(ajaxOptions, {
headers: {
__RequestVerificationToken: token
}
});
} else {
ajaxOptions.headers["__RequestVerificationToken"] = token;
}
$.ajax(ajaxOptions)
.done(function (data, textStatus, jqXHR) {
validateLoginSession(data, textStatus, jqXHR, deferredAjax.resolve);
})
.fail(deferredAjax.reject); // ajax
})
.fail(function () {
deferredAjax.rejectWith(this, arguments); // On token failure pass the token ajax and args
});
return deferredAjax.promise();
}
webapi.safeAjax = safeAjax;
})((window.webapi = window.webapi || {}), jQuery);
// Notification component
var notificationMsg = (function () {
var $processingMsgEl = $("#processingMsg"),
_msg = "Processing...",
_stack = 0,
_endTimeout;
return {
show: function (msg) {
$processingMsgEl.text(msg || _msg);
if (_stack === 0) {
clearTimeout(_endTimeout);
$processingMsgEl.show();
}
_stack++;
},
hide: function () {
_stack--;
if (_stack <= 0) {
_stack = 0;
clearTimeout(_endTimeout);
_endTimeout = setTimeout(function () {
$processingMsgEl.hide();
}, 500);
}
}
};
})();
// Applicaton ajax wrapper
function appAjax(processingMsg, ajaxOptions) {
notificationMsg.show(processingMsg);
return webapi
.safeAjax(ajaxOptions)
.fail(function (response) {
if (response.responseJSON) {
alert("Error: " + response.responseJSON.error.message);
} else {
alert("Error: Web API is not available... ");
}
})
.always(notificationMsg.hide);
}
function updateRecord(recordObj, recordObjId) {
appAjax("Updating...", {
type: "PATCH",
url: `/_api/incidents(${recordObjId})`,
contentType: "application/json",
data: JSON.stringify(recordObj),
success: function (res) {}
});
}
});
function UpdateCase(status) {
const incidentid = "{{request.params.id}}";
let data = {};
if (status == "In-Progress") {
data = { statecode: ChangeItAccordingly, statuscode: ChangeItAccordingly };
} else if (status == "Resolved") {
data = { statecode: ChangeItAccordingly, statuscode: ChangeItAccordingly };
}
updateRecord(data, incidentid);
}
3. Make sure to add the table that you're updating to the site settings.

Please let me know if you have any questions.