Skip to content

Instantly share code, notes, and snippets.

View pchaozhong's full-sized avatar

hirosaki.tokyo pchaozhong

View GitHub Profile

基礎編

アジャイル開発とは?

以下のような進め方を アジャイル開発 と呼ぶ。

  • 関係者は目的の達成のためにお互いに協力し合いながら進める
  • 一度にまとめてではなく少しずつ作り、早い段階から実際に動作するものを届けて評価を繰り返す
  • 利用者の反応や関係者からフィードバックを継続的に得ながら、作っているもの自体や計画を調整する

2001 年に アジャイルソフトウェア開発宣言 を示したのが始まり。

@pchaozhong
pchaozhong / publish.py
Created June 17, 2020 23:22 — forked from cm-fujii/publish.py
Amazon Connect Sample
import boto3
import os
import json
DESTINATION_PHONE_NUMBER = os.getenv('DESTINATION_PHONE_NUMBER')
SOURCE_PHONE_NUMBER = os.getenv('SOURCE_PHONE_NUMBER')
INSTANCE_ID = os.getenv('INSTANCE_ID')
CONTACT_FLOW_ID = os.getenv('CONTACT_FLOW_ID')
connect = boto3.client('connect')
@pchaozhong
pchaozhong / getMethodsAndProperties.js
Created May 26, 2020 05:08 — forked from thisnameissoclever/getMethodsAndProperties.js
ServiceNow: Get Methods and Properties of an object
var methodsAndProperties = [];
var testObj = new GlideFilter('a=b', 'rule'); //TODO: replace this with whatever object you want to test
getMethodsAndProperties(methodsAndProperties, testObj);
gs.print('\n' + methodsAndProperties.join('\n'));
/**
* Populates an extant array in-place, of methods and properties of a given object.
* @param methodsAndProperties {array} - the array to populate/modify in-place.
/***CLASSES***/
class APIClass {
/**
* An APIClass object
* @param name {string} The name of the API class
*/
constructor(name, classDesc = '') {
this._className = name;
this._classDescription = classDesc;
/**
@pchaozhong
pchaozhong / DynamicRefQuals.js
Created May 26, 2020 05:08 — forked from thisnameissoclever/DynamicRefQuals.js
DynamicRefQuals (Client-callable Script Include)
var DynamicRefQuals= Class.create();
DynamicRefQuals.prototype = Object.extendsObject(AbstractAjaxProcessor, {
//Client-callable
/*
To quickly and easily create a dynamic reference qualifier script, simply add a custom method to this Script Include.
Here are the guidelines for modifying this Script Include:
1. In the "@author" JSDoc tag of the method your implement, please put your user ID (For example: "twoodruff").
2. See how the getGroupMembersByID and getGroupMembersByName methods are documented, and try to document your method in the same fashion.
3. Unless you've got permission from the author, please do not modify anyone else's methods.
/**
* Does the work on each loop.
* @param {Number} [limit=10] - The number of records to process per loop.
* @param {Number} [currentNumber=0] - The number of records that have been processed so far, by all previous loops.
*/
function eventWrapper(limit, currentNumber) {
var EVENT_NAME = 'EVENT.NAME.HERE'; //todo: Update this to the name of the event you've created.
var TABLE_NAME = 'TABLE_NAME_HERE'; //todo: Update this to the name of the table containing the records you're processing
var QUERY = 'some_query=here'; //todo: Put your query here
@pchaozhong
pchaozhong / global.getAttachmentContentsAsString.js
Created May 26, 2020 05:07 — forked from thisnameissoclever/global.getAttachmentContentsAsString.js
Get a ServiceNow attachment file's contents as a string (Global)
var tableName = 'incident';
var recordID = '755d52b137b0b30090b68cf6c3990e6f';
gs.print(getAttachmentContentsAsString(tableName, recordID));
function getAttachmentContentsAsString(tableName, recordID) {
//Declare a new instance of GlideSysAttachment.
var gsa = new GlideSysAttachment();
//Get the raw bytes in the file
var bytesInFile = gsa.getBytes(tableName, recordID);
//Convert that jive into a string using Java/Rhino.
@pchaozhong
pchaozhong / global.getAttachmentStringByName.js
Created May 26, 2020 05:06 — forked from thisnameissoclever/global.getAttachmentStringByName.js
Get the string value of an attachment (which must be a text-formatted file, like .txt, .csv. or .xml) in ServiceNow
var tableName = 'incident';
var sysIDOfRecord = '755d52b137b0b30090b68cf6c3990e6f';
var fileNameSansExtension = 'example text doc'; //Full file name: example text doc.txt
var grRecordWithAttachment = new GlideRecord(tableName);
grRecordWithAttachment.get(sysIDOfRecord);
var gsa = new GlideSysAttachment();
//ONLY works in global
var textVal = gsa.get(grRecordWithAttachment, fileNameSansExtension);
@pchaozhong
pchaozhong / copySpecificAttachment.js
Created May 26, 2020 05:06 — forked from thisnameissoclever/copySpecificAttachment.js
ServiceNow script to copy a specific attachment from one record to another
copySpecificAttachment(donorTable, donorID, recipientTable, recipientID, fileName);
function copySpecificAttachment(donorTable, donorID, recipientTable, recipientID, fileName) {
var donorAttSysID;
var newAttRecord;
var linkToNewRecord;
var attDataRecord;
var newDocRecord;
var attRecord = new GlideRecord('sys_attachment');
attRecord.addQuery('table_name', donorTable);
@pchaozhong
pchaozhong / scope.getAttachmentContentsAsString.js
Created May 26, 2020 05:05 — forked from thisnameissoclever/scope.getAttachmentContentsAsString.js
Get a ServiceNow attachment file's contents as a string (Scope)
var recordTable = 'incident';
var idOfRecord = '755d52b137b0b30090b68cf6c3990e6f';
var grAttachment = getAttachmentRecord(recordTable, idOfRecord, 'example text doc.txt', true);
var gsaTextFile = new GlideSysAttachment();
var strContents = gsaTextFile.getContent(grAttachment); //ONLY worked in non-global scope
gs.info(strContents);
/**