statusName = "Open";
parentObj = context.get("parent");
requestObj = parentObj.get("request");
apiPrefix = "/app/" + context.get("instance") + "/api/v3/";
requestURL = apiPrefix + "requests/" + requestObj.get("id");
update = zoho.sdp.invokeurl
[
url :requestURL
type :PUT
parameters:{"input_data":{"request":{"status":{"name":‘Statusname’}}}}
];
info update;
4. 要实现自动指派回复工单的技术,请在这个trigger里再添加一条自定义函数,然后写入下面的代码(请注意,工单只能自动指派给同地点的技术)
updateReason = "Technician replied to this ticket";
requestObj = context.get("parent").get("request");
sender = notificationObj.get("sender");
if(requestObj.get("technician") == null && sender.get("is_technician"))
{
updateRequest = zoho.sdp.invokeurl
[
url :"/app/" + context.get("instance") + "/api/v3/requests/" + requestObj.get("id")
type :PUT
parameters:{"input_data":{"request":{"technician":{"email_id":sender.get("email_id")},"update_reason":updateReason}}}
];
info updateRequest.get("response_status");
}