Last active
June 8, 2019 18:23
-
-
Save williamli/df439215325c6e5f8af6e672cdbcd32f to your computer and use it in GitHub Desktop.
Zendesk Macros - Generates a 5-dictionary-words random code from ticket ID (up to 5 digits) and a random number based on current timestamp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generates a 5-dictionary-words random code from ticket ID (up to 5 digits) and a random number based on current timestamp. | |
// This sample comes loaded with 500 random dictionary words. | |
{% assign words = "annoyed, old-fashioned, rhyme, brief, powder, celery, fragile, number, flow, goofy, plastic, deserve, mother, invite, chief, opposite, numerous, sleet, soup, humorous, shelter, superb, receptive, treat, obey, knowing, wash, afford, ban, order, wave, employ, devilish, ripe, destruction, tree, hat, use, uninterested, materialistic, frantic, receipt, alleged, sack, station, entertain, nasty, week, cause, bucket, lazy, abject, juice, disagreeable, acid, seashore, tender, flagrant, garrulous, shrill, vague, bed, sour, curly, lame, delay, land, play, obsolete, immense, upset, extra-small, committee, absorbed, nondescript, shiver, languid, irate, zephyr, whistle, motionless, alcoholic, spiteful, damaged, swanky, blood, pollution, sheep, lake, punish, check, space, need, engine, plough, fairies, tomatoes, run, crush, brass, incompetent, pour, flag, roasted, motion, suck, festive, excite, gaudy, rhetorical, company, mom, endurable, abstracted, temporary, ambitious, agreeable, sweet, drawer, hypnotic, cats, secretary, questionable, protective, complete, attract, wrathful, sophisticated, vengeful, leather, mountain, skinny, coach, acoustic, tricky, haircut, aunt, shave, overjoyed, efficacious, faulty, fill, yellow, hideous, mitten, violet, uttermost, hurt, hand, gifted, sparkle, unkempt, discussion, achiever, dangerous, comfortable, miscreant, launch, cannon, selfish, narrow, yak, weigh, safe, sigh, tidy, roomy, arrive, dance, delicious, wool, answer, sign, control, announce, time, wind, tire, pie, smooth, tan, lick, unequal, pull, addicted, doubt, power, toothsome, snotty, alarm, caption, living, snore, unwieldy, divergent, cake, unnatural, diligent, tacit, rotten, ugly, taboo, alluring, marvelous, marble, root, trick, malicious, measly, end, vanish, hilarious, value, momentous, tempt, ray, downtown, linen, cattle, person, sparkling, mark, forgetful, teaching, furniture, sin, recondite, want, back, hissing, polite, profit, crawl, bump, long-term, walk, dreary, tall, uncle, women, bag, macabre, ritzy, science, poke, angry, gaping, baby, fog, sail, thaw, attractive, spotted, bridge, two, demonic, worried, telling, crowd, boat, locket, unfasten, cushion, silk, chubby, greedy, toy, greasy, pause, frail, kettle, juvenile, mass, rabbits, cracker, barbarous, cream, abnormal, glamorous, bubble, reason, secretive, coast, float, curl, female, abaft, vast, blow, hurried, curious, wry, testy, joyous, blue, smash, hammer, cry, whirl, breezy, sturdy, request, bad, choke, childlike, cautious, funny, fair, wax, impartial, charming, periodic, voice, madly, awful, cars, texture, hope, admit, skin, sordid, comb, cloth, nutty, lunchroom, accurate, number, dam, drunk, therapeutic, wing, trucks, picture, close, fold, nod, succeed, entertaining, giant, wrap, vessel, famous, short, responsible, super, coherent, bike, rely, cute, boundary, clover, adhesive, mature, null, print, seat, waiting, cruel, womanly, tap, heap, fumbling, smoke, match, righteous, attack, fire, liquid, knowledgeable, scream, gun, town, interesting, playground, mouth, flood, wandering, lock, laborer, automatic, hate, tooth, orange, unit, stormy, magnificent, amusing, teeny-tiny, remember, material, wilderness, plucky, rule, jam, zoom, fang, flower, outgoing, tin, post, hook, magenta, red, uneven, planes, increase, curved, naughty, rare, jumpy, chop, toes, ocean, angle, flavor, cough, mysterious, rake, undress, act, squeak, kiss, metal, callous, badge, precious, needless, heartbreaking, book, apparel, tightfisted, cheerful, valuable, dizzy, thoughtless, analyse, ashamed, unusual, pathetic, squalid, actor, empty, thumb, add, envious, erect, excited, nervous, moaning, fast, interrupt, odd, handle, structure, false, temper, flowers, sad, insurance, somber, trap, fixed, tent, elegant, amuck, smart, film, decorate, stereotyped, square, army, practise, unique, animal, skillful, calendar, bulb, provide, wipe, kindly, offbeat, substantial, foamy, impress, imagine, credit, threatening, second, wealthy, icky, label, train, gabby, afterthought, scene, pen, discreet, glistening, sound, breakable" | split: ", " %}{% assign min = 0 %}{% assign max = 10000 %}{% assign diff = max | minue: min %}{% assign randomNumber = "now" | date: "%N" | modulo: diff | plus: min %}{% assign code1 = ticket.id | modulo: 100000 | divided_by: 10000 | plus: 12 | plus: randomNumber | modulo: 499 %}{% assign code2 = ticket.id | modulo: 10000 | divided_by: 1000 | plus: 1 | plus: randomNumber | modulo: 499 %}{% assign code3 = ticket.id | modulo: 1000 | divided_by: 100 | plus: 4 | plus: randomNumber | modulo: 499 %}{% assign code4 = ticket.id | modulo: 100 | divided_by: 10 | plus: 13 | plus: randomNumber | modulo: 499 %}{% assign code5 = ticket.id | modulo: 10 | divided_by: 1 | plus: 21| plus: randomNumber | modulo: 499 %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment