在 ServiceNow 中,我在业务登录中编写了脚本 - 脚本操作。在添加和删除时,我得到了 sysId,但在重命名附件时,我无法获得 sys_id。
sendnotification();
function sendnotification()
{
try
{
var r = new sn_ws.RESTMessageV2('IqtrackTest', 'AttachmentPost');
r.setStringParameterNoEscape('sys_id',current.sys_id);
r.setStringParameterNoEscape('sysparm_TableName',current.getTableName());
r.setStringParameterNoEscape('Action',"Attachment_Renamed");
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex)
{
var message = ex.getMessage();
}
}