1) 为新员工入职流程配置触发器。
gotomeeting_token = "<your goto meeting token>";
portal_name = "<your portal>";
start_time_udf_key = "<your additional date field key - to note start time>";
end_time_udf_key = "<your additional date field key - to note end time>";
/*Code logic from the below*/
template = requestObj.get("template").get("name");
if(template == "Employee Onboarding")
{
subject = requestObj.get("subject");
request_id = requestObj.get("id");
start_time = requestObj.get("udf_fields").get(start_time_udf_key).get("value");
end_time = requestObj.get("udf_fields").get(end_time_udf_key).get("value");
meeting_start_time = start_time.toTime().toString("yyyy-MM-dd'T'HH:mm:ss'.000Z'");
meeting_end_time = end_time.toTime().toString("yyyy-MM-dd'T'HH:mm:ss'.000Z'");
gotomeeting_data = Map();
gotomeeting_data.put("subject",subject);
gotomeeting_data.put("starttime",meeting_start_time);
gotomeeting_data.put("endtime",meeting_end_time);
gotomeeting_data.put("passwordrequired","false");
gotomeeting_data.put("conferencecallinfo","--from sdpod--");
gotomeeting_data.put("timezonekey","string");
gotomeeting_data.put("meetingtype","immediate");
header = {"Authorization":gotomeeting_token,"Accept":"application/json","Content-Type":"application/json"};
/*Below line triggers api call to gotomeeting and response provided by gotomeeting is captured in response_from_goto*/
response_from_goto = postUrl("https://api.getgo.com/G2M/rest/meetings",gotomeeting_data + "",header + "",true);
join_url = response_from_goto.toMap().get("joinURL");
/*Below code creates notes in sdpod with the joinurl, which was got from gotomeeting's response*/
sdpod_response = zoho.sdp.invokeurl
[
url :"/app/" + portal_name + "/api/v3/requests/" + request_id + "/notes"
type :POST
parameters:{"input_data":{"request_note":{"description":"A meeting has been scheduled in gotomeeting by the system. Join Url for gotomeeting is <a href='" + join_url + "'>" + join_url + "</a>"}}}
];
}
2) 在 JIRA 中为网络相关事件请求创建问题单。
appName = context.get("instance");
reqTitle = requestObj.get("subject");
reqID = requestObj.get("id");
problemURL = "/app/" + appName + "/api/v3/problems";
problem = zoho.sdp.invokeurl
[
url :problemURL
type :POST
parameters:{"input_data":{"problem":{"title":reqTitle}}}
];
associateURL = problemURL + "/" + problem.get("problem").get("id") + "/requests";
association = zoho.sdp.invokeurl
[
url :associateURL
type :POST
parameters:{"input_data":{"request_problem_association":{{"request":{"id":reqID}}}}}
];
info association;
3) 排除 Power BI 无法访问的问题