请求触发器用例

请求触发器用例

1)  为新员工入职流程配置触发器。

  • 在创建或编辑过程中,对所有请求配置触发器。
  • 根据请求描述和模板设置执行触发器的条件
  • 选择在编辑请求条件中的任何字段时执行触发器。
  • 执行与资产供应、员工资源获取通知和更新 Active Directory 相关的自定义动作。
  • 使用以下自定义功能在 GoToMeeting 中安排团队会议:
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 中为网络相关事件请求创建问题单。

  • 在创建或编辑过程中对所有请求执行触发。
  • 设置触发条件,以便在请求主题包含关键字 "network"、"internet"、"WiFi "或 "Lan "时执行。
  • 选择在编辑请求条件中的任何字段时执行触发器。
  • 使用以下自定义函数创建 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 无法访问的问题

  • 在创建或编辑过程中对所有请求执行触发器。
  • 设置触发器条件,在请求模板为无法访问应用程序且主题包含 "Power BI "时执行。
  • 选择在编辑请求条件中的任何字段时执行触发器。
  • 配置以下任务并将其分配给相关技术人员:
    • 检查代理验证错误
    • 检查 "不支持非HTTPS URL 重定向 "错误
    • 启用跟踪功能并诊断日志错误
    • 启用网络代理身份验证的默认系统凭证