Golang script for interacting with Salesforce API.
The script is meant to be used mainly for Salesforce users instead of admins.
The drive behind this was/is to automate repetitive and tedious tasks within the technical support engineer role like:
To accomplish such, the script is executed as a CLI tool.
NOTE: Source code and compiled binary are available in case of not having/preferring Docker. However, the execution is recommended via Docker.
docker run -it rabocse/salesforce-backlog-cli
export [email protected]
export PASS=MyFakePassword123
export SF=myfake.sf.instance.salesforce.com
export CLID=xxxxxxxyyyyyyyyyyaaaaaaabbbbbbbbdddddddddddd22211111
export CLSE=11111112222222333333344444aaaaaccccc1112222222
export SECK=BAD23XXXXXXXXFFF
./main
The tool successfully requests an access token to the Salesforce Instance to authenticate and then downloads the data from sObjects/case resource ("/services/data/v55.0/sobjects/case").
First, the user must set the needed credentials to authenticate against the Salesforce API. For such, environment variables are passed in the container CLI.
Once, the environment variables are set, the tool is ready to be executed:
❯ ./main
+--------------------+
| SALESFORCE BACKLOG |
+--------------------+
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| # | CASE NUMBER | CONTACT NAME | SUBJECT | SEVERITY | STATUS | ENVIRONMENT |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 1 | 1234567 | Dexter | [AMER] Dee Dee Pushed some | Sev1 (High) | Open | Dexter's Lab |
| | | | Config and Services Now Are | | | |
| | | | Down | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 2 | 1234568 | Johnny Bravo | [AMER] Need Her Contact Number | Sev1 (High) | Open | Johnny's Mom's House |
| | | | ASAP!!! | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 3 | 7654321 | Dexter | [AMER] Quantum Scaling | Sev3 (Normal) | Open | Dexter's Lab |
| | | | Sometimes Fails | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 4 | 1122334 | Hyoga C. | [EMEA] Frozen Container is | Sev3 (Normal) | Open | Knights of the Zodiac |
| | | | Leaking Memory | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 5 | 9876543 | Master Roshi | [APAC] KameHouse Service Not | Sev3 (Normal) | Open | DBZ |
| | | | Accesible After Changing Cert | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 6 | 1234566 | Kakashi Hatake | [APAC] Unable to Deploy | Sev4 (Normal) | Open | Konoha Leaf Village |
| | | | Rinnegan Service. Stuck In MS | | | |
| | | | Phase 2 | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 7 | 1234555 | Aizen Sosuke. | [APAC] PROACTIVE: Upgrade | Sev3 (Low) | Open | Gotei 13 Inc |
| | | | Shinigami's Cluster to same | | | |
| | | | version than Espada's Cluster | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
| 8 | 7777777 | Tony Stark | [EMEA] Ultron's service does | Sev3 (Low) | Open | Stark Labs (Sokovia Center) |
| | | | not work as expected. | | | |
+-----+-------------+----------------+--------------------------------+---------------+--------+-----------------------------+
The script reads the environment variables (EMAIL, PASS, SF, CLID, CLSE, SECK) from the user's terminal.
Such environment variables are used to authenticate against the Salesforce instance and get an access token.
Once the access token is properly downloaded and parsed, then it is used in a HTTP header for the data request.
The listview (Salesforce resource) is queried and successfully unmarshalled to then be printed in a table format.
The listview ID is currently hardcoded within sftool.BuildURL function.
The Salesforce API version is also hardcoded to v55.0.
NOTE: Roadmap is subject to changes.
Content type
Image
Digest
sha256:ce30754e3…
Size
113.9 MB
Last updated
about 4 years ago
docker pull rabocse/salesforce-backlog-cli