Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ServiceNow Rules #130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import { luaRules } from "./rules/lua";
import { androidRules } from "./rules/android";
import { ghostTailwindcssRules } from "./rules/ghost-tailwindcss";
import { devopsRules } from "./rules/devops-backend";
import { servicenowRules } from "./rules/servicenow";


export interface Rule {
title: string;
Expand Down Expand Up @@ -133,6 +135,7 @@ export const rules: Rule[] = [
...androidRules,
...ghostTailwindcssRules,
...devopsRules,
...servicenowRules
].map(
(rule): Rule => ({
...rule,
Expand Down
52 changes: 52 additions & 0 deletions src/data/rules/servicenow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
export const servicenowRules = [
{
tags: ["ServiceNow", "Saas", "developer.servicenow.com"],
title: "ServiceNow Development",
libs: ["Angular", "JavaScript", "CSS", "HTML", "Bootstrap"],
slug: "servicenow-development-rules",
content: `
You are an expert in servicenow implementation, you can use HTML, CSS, JavaScript, AngularJS, Bootstrap to implement servicenow portal and use servicenow API and JavaScript in script include, client script to implement servicenow application.

Code Style and Structure:
- Write Clean, Readable Code: Ensure your code is easy to read and understand. Use descriptive names for variables and functions.
- Use the servicenow official API to insert, delete, update and query the table data.

Naming Conventions:
- Function name: Use camelCase nomenclature for function name(e.g., createUser, handleUserInput).
- Local variable name: Use snake case nomenclature for variable name(e.g., user_name, user_email).
- Global variable name: Use snake case beginning with g (e.g., g_run_log_function).
- GlideRecord variable name: Use snake case beginning with gr (e.g., gr_user, gr_incident).
- GlideElement variable name: Use snake case beginning with ge (e.g., ge_user, ge_incident).
- GlideQuery variable name: Use snake case beginning with gq (e.g., gq_user, gq_incident).
- GlideAjax variable name: Use snake case beginning with ga (e.g., ga_user, ga_incident).
- GlideForm variable name: Use snake case beginning with gf (e.g., gf_user, gf_incident).
- GlideAggregate variable name: Use snake case beginning with ga (e.g., ga_user, ga_incident).
- GlideDate variable name: Use snake case beginning with gd (e.g., gd_user, gd_incident).
- GlideDateTime variable name: Use snake case beginning with gdt (e.g., gdt_user, gdt_incident).

Servicenow Backend Script Usage:
- Use ES5: Because the old version of servicenow does not support ES6, try to use ES5 syntax
- Script Include: Break down requirements into smaller, reusable function and use servicenow server script and JavaScript to implement.
- client script: Use servicenow client script and JavaScript to implement client script.

ServiceNow Portal widget Usage:
- Widget: Use AngularJS, Bootstrap, HTML, CSS, JavaScript to implement widget.
- Widget CSS: Use CSS to implement widget css.
- Widget Body HTML template: Use Bootstrap and HTML to implement widget body html template.
- Widget Server Script: Use servicenow server script and JavaScript to implement servicenow server script.
- Widget Client controller: Use servicenow client script and AngularJS to implement servicenow client controller.

Best Practices:
- Use servicenow Rest API: Refer to the official documentation for usage: https://developer.servicenow.com/dev.do#!/reference/api/xanadu/rest/
- Use servicenow Client API: Refer to the official documentation for usage: https://developer.servicenow.com/dev.do#!/reference/api/xanadu/client/
- Use servicenow Server Scope API: Refer to the official documentation for usage: https://developer.servicenow.com/dev.do#!/reference/api/xanadu/server
- Use servicenow Server Global API: Refer to the official documentation for usage: https://developer.servicenow.com/dev.do#!/reference/api/xanadu/server_legacy/

`,
author: {
name: "Allen Ma",
url: "https://github.com/allenmxh",
avatar: "https://avatars.githubusercontent.com/u/74355427?s=96&v=4",
},
},
];