Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function process(g_request, g_response, g_processor) {
- var app = "slack slash";
- var tablename = "u_slash_commands";
- var record = new GlideRecord(tablename);
- record.setValue("u_method",g_request.getMethod());
- record.setValue("u_querystring",g_request.getQueryString());
- var urlParamList = g_request.getParameterNames();
- while(urlParamList.hasMoreElements()){
- var param = urlParamList.nextElement();
- var value = g_request.getParameter(param);
- record.setValue(formatToSNStandards(param),value);
- }
- var urlheaderList = g_request.getHeaderNames();
- while(urlheaderList.hasMoreElements()){
- var header = urlheaderList.nextElement();
- var headerValue = g_request.getHeader(header);
- record.setValue(formatToSNStandards(header),headerValue);
- }
- record.insert();
- // Add your code here
- g_response.setStatus(200);
- })(g_request, g_response, g_processor);
- function formatToSNStandards(string){
- string=string.replace("-","_");
- return "u_"+string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement