This bot is what controls the @Points-Thing bot on the sndevs.com workspace.
On the SNDevs workspace, we like to give kudos to each other! Especially when someone has been particularly helpful (answered a ServiceNow question, helped review a code snippet, or simply pointed to the right documentation) or even when someone provided a much needed laugh (a funny joke, a well-timed meme, or simple relatable musings).
To give those kudos, we made the Points-Thing bot! Simply @ mention someone and put ++ right after to give them a point.
@AbelTuter ++
And the bot keeps track (via a ServiceNow instance) of how helpful that person has been. Now user can quickly see who in the community has been a great contributor. And contributors have a way to show credibility in their responses.
The bot evolved from there and functionality has been added onto it ever since it was created in 2017.
🔔🔔🔔
CONTRIBUTORS must follow all guidelines in CONTRIBUTING.md or run the risk of having your Pull Requests labeled as spam.
🔔🔔🔔
- Fork this repo
- Go to your ServiceNow instance
- Go to
System Applications
=>Studio
- Once Studio loads, select
Import From Source Control
- Use your forked repo to Import your application
- See below on how to get this bot working on your own server
- Make updates to the application (see CONTRIBUTING.md for additional details)
- In Studio, commit your changes to source control
- Submit a pull request to the ServiceNowDevProgram/Points-Thing
main
branch
An accepted Pull Request and merge does not necessarily mean the functionality will go live immediately, as an admin for the host instance will need to pull the application into ServiceNow.
- Create a new app, select "From an app manifest"
- Select the workspace into which you want to install this app
- Copy and paste the manifest from either appmanifest.json or appmanifest.yaml
- Create the app
- Navigate to
Features
>Event Subscriptions
- Populate the
Request URL
with: https://YOURDEVINSTANCE.service-now.com/api/x_snc_pointsthing/points_thing
When you tab out of the field, make sure the URL is "Verified" before you proceed.
- Navigate to
Settings
>Install App
- Click the
Install to Workspace
button - Verify the
view
anddo
permissions - Click the
Allow
button - Copy the
Bot User OAuth Token
for the ServiceNow system property configuration later
- Create a new app, select "From scratch"
- Select the workspace into which you want to install this app
- Navigate to
Features
>Event Subscriptions
- Turn on
Enable Events
- Populate the
Request URL
with: https://YOURDEVINSTANCE.service-now.com/api/x_snc_pointsthing/points_thing
When you tab out of the field, make sure the URL is "Verified" before you proceed.
- Expand the
Subscribe to bot events
section - Click the
Add bot User Event
button - Search for and select
message.channels
- Search for and select
message.groups
- Click the
Save Changes
button - Navigate to
Features
>OAuth & Permissions
- Scroll down to
Bot Token Scopes
- Click the
Add an OAuth Scope
button - Search for and select
chat:write
- Search for and select
users:read
- Navigate to
Settings
>Install App
- Click the
Install to Workspace
button - Verify the
view
anddo
permissions - Click the
Allow
button - Copy the
Bot User OAuth Token
for the ServiceNow system property configuration later
- Create a global property called "pointsthing.token" and place your bot token in this property.
- Invite your bot to a channel
- @ mention someone in your server with a ++, eg.
@Earl Duque ++
- Check the Payload
x_snc_pointsthing_payload
table to make sure SN is receiving messages - Check 'Outbound HTTP Requests' to make sure the bot is replying to the channel