Salto for
Zendesk
Articles
SHARE
Scott Dixon
December 20, 2023
4
min read
One of Salto's customer, a large retail company, has a huge Zendesk instance: their production environment has about 16 000 macros. To clean up and manage all these macros and other configuration elements that depend on them, they needed a better change management process.
Having Salto as their configuration management platform for Zendesk helped get full visibility into their macro library (you can try it for yourself with our 1-month free trial>>). But to clean up the macros that are no longer needed, we had to come up with a process where different divisions that create and use macros can align on the cleanup process.
The first step was to categorize and sort all existing macros.
The customer has a naming strategy for their macros where they used the “::” syntax in Zendesk to categorize by division that owned the macro. We agreed on a strategy where we would provide a Google spreadsheet containing all the macros in production, broken down by the division, and share with everyone across the company who needs to review them. The spreadsheet would also contain a column to mark macros as "reviewed" as well as those marked for deletion.
But adding 16,000 macros to this spreadsheet manually would take weeks. It would be much faster to use a script to create the list of all macros with the division name and a link back to Salto. I used ChatGPT to generate a Python script using the following prompt:
You have a folder that holds .nacl files from Salto that represent individual configurations within 1 Zendesk environment. You need to provide a list of these configurations with these 5 attributes:
1. salto_id: the Salto ID
2. zendesk_title: The actual title of the configuration in Zendesk
3. department: The department that owns the configuration
4. salto_url: The URL to access the configuraion in Salto
Here is an example of the contents a nacl file:
zendesk.macro SRD__FAQs__test_macro@ffffs {
title = "SRD::FAQs::test macro"
active = true
default = false
description = "a test macro"
actions = [
{
field = "ticket_form_id"
value = zendesk.ticket_form.instance.SRD___Enable_new_feature@sbsss
},
{
field = "subject"
value = "SRD FAQ"
},
]
raw_title = "SRD::FAQs::test macro"
}
For more information on .nacl files, here is a link to the documentation on .nacl syntax: https://github.com/salto-io/salto/blob/main/docs/user_guide.md#nacl-case.
1. The Salto ID (salto_id)
This ID can be found by opening the file and finding the string of text that follows "zendesk.macro" up until the "{" character on the first line. In the example above, the salto_id is: "SRD__FAQs__test_macro@ffffs".
2. The actual title of the configuration in Zendesk (zendesk_title)
This title can be found by locating the value of the "raw_title" attribute in the .nacl file. In the example above, the zendesk_title is: "SRD::FAQs::test macro".
3. the department that owns the configuration (department)
The department that owns the configuration can be found by parsing the zendesk_title and extracting the first string that occurs before the first "::". In the example above, the department is: "SRD".
4. The URL to access the configuration in Salto (salto_url)
The URL can be constructed by using the salto_id in conjunction with the Salto organization ID (org_id) and the Salto environment id (env_id). In the example above, assuming the that org_id is 6beb4cab-b3c4-40bb-b181-20e4c49e83a2 and the env_id is a5236736-1be2-4b67-be5c-6883e6a6439d, the salto_url is https://app.salto.io/orgs/6beb4cab-b3c4-40bb-b181-20e4c49e83a2/envs/a5236736-1be2-4b67-be5c-6883e6a6439d/explore?element=zendesk.macro.instance.SRD__FAQs__test_macro@ffffs.
Provide a Python script that will generate a csv file that lists each configuration with its salto_id, zendesk_title, department, and salto_url.
After some tweaking, I ended up with the following script:
We provided this script to the customer to run on their Git repository locally (Salto can automatically create and update a repository for each Zendesk environment you connect). They moved the output of the CSV into a Google spreadsheet which I reformatted according to their requirements:
Additionally, the customer wanted to know which macros had missing references. I used the below prompt for ChatGPT to generate a Python script:
You have a folder that holds .nacl files from Salto that represent individual configurations within 1 Zendesk environment. You need to provide a list of all of the configurations that have a missing reference. Here is an example of a .nacl file with a missing reference:
zendesk.macro DanAvigdorAwesomeMacroDemo {
title = "DanAvigdorAwesomeMacroDemo"
active = true
default = false
description = "Demo"
actions = [
{
field = zendesk.ticket_field.instance.KingDanAvigdor_tagger
value = zendesk.ticket_field__custom_field_options.instance.missing_10402303135255
},
]
raw_title = "DanAvigdorAwesomeMacroDemo"
_alias = "DanAvigdorAwesomeMacroDemo"
}
In the above example "zendesk.ticket_field__custom_field_options.instance.missing_10402303135255" is a missing reference because the last part of the string (missing_10402303135255) contains the string "missing" along with a numeric string. This script should only list the configurations that contain a missing reference. And once you have identified the missing reference, the configuration should be listed with the following 5 attributes (in that order):
1. salto_id: the Salto ID
2. zendesk_title: The actual title of the configuration in Zendesk
3. division: The division that owns the configuration
4. salto_url: The URL to access the configuration in Salto
For more information on .nacl files, here is a link to the documentation on .nacl syntax: https://github.com/salto-io/salto/blob/main/docs/user_guide.md#nacl-case.
1. The Salto ID (salto_id)
This ID can be found by opening the file and finding the string of text that follows "zendesk.macro" up until the "{" character on the first line. In the example above, the salto_id is: "SRD__FAQs__test_macro@ffffs".
2. The actual title of the configuration in Zendesk (zendesk_title)
This title can be found by locating the value of the "raw_title" attribute in the .nacl file. In the example above, the zendesk_title is: "SRD::FAQs::test macro".
3. the division that owns the configuration (division)
The division that owns the configuration can be found by parsing the zendesk_title and extracting the first string that occurs before the first "::". In the example above, the division is: "SRD". If there is no "::" in the zendesk_title, that this configuration doesn't belong to a particular division. So in that case, the division can be left blank.
4. The URL to access the configuration in Salto (salto_url)
The URL can be constructed by using the salto_id in conjunction with the Salto organization ID (org_id) and the Salto environment id (env_id). In the example above, assuming the that org_id is 6beb4cab-b3c4-40bb-b181-20e4c49e83a2 and the env_id is a5236736-1be2-4b67-be5c-6883e6a6439d, the salto_url is https://app.salto.io/orgs/6beb4cab-b3c4-40bb-b181-20e4c49e83a2/envs/a5236736-1be2-4b67-be5c-6883e6a6439d/explore?element=zendesk.macro.instance.SRD__FAQs__test_macro@ffffs.
Provide a Python script that will look inside a folder at all the nacl files (assume that all nacl files are in a single folder. so you can provide a path to that folder.) and generate a csv file that lists each configuration with its division first, then the zendesk_title, then the salto_url, and then the salto_id
Here's the script I sent to the customer after some tweaking:
They were able to run this script and after sharing the output, we formatted the final spreadsheet for them to review with their internal devisions. In hindsight, I could have combined these two into a single sheet that marks a particular macro for having a missing reference.
By using Salto, ChatGPT and Git, we were able to automate the process that otherwise would take their team weeks to accomplish—or would eventually translate into technical debt that blocks their customer support from staying more agile and effective.
You're welcome to try this hack if you have hundreds of Zendesk macros that you need to clean up. You will be able to do that with Salto's free trial! If you want to see Salto in action and chat with Salto experts, get in touch with us.
Salto for
Zendesk
SHARE
Scott Dixon
December 20, 2023
4
min read
One of Salto's customer, a large retail company, has a huge Zendesk instance: their production environment has about 16 000 macros. To clean up and manage all these macros and other configuration elements that depend on them, they needed a better change management process.
Having Salto as their configuration management platform for Zendesk helped get full visibility into their macro library (you can try it for yourself with our 1-month free trial>>). But to clean up the macros that are no longer needed, we had to come up with a process where different divisions that create and use macros can align on the cleanup process.
The first step was to categorize and sort all existing macros.
The customer has a naming strategy for their macros where they used the “::” syntax in Zendesk to categorize by division that owned the macro. We agreed on a strategy where we would provide a Google spreadsheet containing all the macros in production, broken down by the division, and share with everyone across the company who needs to review them. The spreadsheet would also contain a column to mark macros as "reviewed" as well as those marked for deletion.
But adding 16,000 macros to this spreadsheet manually would take weeks. It would be much faster to use a script to create the list of all macros with the division name and a link back to Salto. I used ChatGPT to generate a Python script using the following prompt:
You have a folder that holds .nacl files from Salto that represent individual configurations within 1 Zendesk environment. You need to provide a list of these configurations with these 5 attributes:
1. salto_id: the Salto ID
2. zendesk_title: The actual title of the configuration in Zendesk
3. department: The department that owns the configuration
4. salto_url: The URL to access the configuraion in Salto
Here is an example of the contents a nacl file:
zendesk.macro SRD__FAQs__test_macro@ffffs {
title = "SRD::FAQs::test macro"
active = true
default = false
description = "a test macro"
actions = [
{
field = "ticket_form_id"
value = zendesk.ticket_form.instance.SRD___Enable_new_feature@sbsss
},
{
field = "subject"
value = "SRD FAQ"
},
]
raw_title = "SRD::FAQs::test macro"
}
For more information on .nacl files, here is a link to the documentation on .nacl syntax: https://github.com/salto-io/salto/blob/main/docs/user_guide.md#nacl-case.
1. The Salto ID (salto_id)
This ID can be found by opening the file and finding the string of text that follows "zendesk.macro" up until the "{" character on the first line. In the example above, the salto_id is: "SRD__FAQs__test_macro@ffffs".
2. The actual title of the configuration in Zendesk (zendesk_title)
This title can be found by locating the value of the "raw_title" attribute in the .nacl file. In the example above, the zendesk_title is: "SRD::FAQs::test macro".
3. the department that owns the configuration (department)
The department that owns the configuration can be found by parsing the zendesk_title and extracting the first string that occurs before the first "::". In the example above, the department is: "SRD".
4. The URL to access the configuration in Salto (salto_url)
The URL can be constructed by using the salto_id in conjunction with the Salto organization ID (org_id) and the Salto environment id (env_id). In the example above, assuming the that org_id is 6beb4cab-b3c4-40bb-b181-20e4c49e83a2 and the env_id is a5236736-1be2-4b67-be5c-6883e6a6439d, the salto_url is https://app.salto.io/orgs/6beb4cab-b3c4-40bb-b181-20e4c49e83a2/envs/a5236736-1be2-4b67-be5c-6883e6a6439d/explore?element=zendesk.macro.instance.SRD__FAQs__test_macro@ffffs.
Provide a Python script that will generate a csv file that lists each configuration with its salto_id, zendesk_title, department, and salto_url.
After some tweaking, I ended up with the following script:
We provided this script to the customer to run on their Git repository locally (Salto can automatically create and update a repository for each Zendesk environment you connect). They moved the output of the CSV into a Google spreadsheet which I reformatted according to their requirements:
Additionally, the customer wanted to know which macros had missing references. I used the below prompt for ChatGPT to generate a Python script:
You have a folder that holds .nacl files from Salto that represent individual configurations within 1 Zendesk environment. You need to provide a list of all of the configurations that have a missing reference. Here is an example of a .nacl file with a missing reference:
zendesk.macro DanAvigdorAwesomeMacroDemo {
title = "DanAvigdorAwesomeMacroDemo"
active = true
default = false
description = "Demo"
actions = [
{
field = zendesk.ticket_field.instance.KingDanAvigdor_tagger
value = zendesk.ticket_field__custom_field_options.instance.missing_10402303135255
},
]
raw_title = "DanAvigdorAwesomeMacroDemo"
_alias = "DanAvigdorAwesomeMacroDemo"
}
In the above example "zendesk.ticket_field__custom_field_options.instance.missing_10402303135255" is a missing reference because the last part of the string (missing_10402303135255) contains the string "missing" along with a numeric string. This script should only list the configurations that contain a missing reference. And once you have identified the missing reference, the configuration should be listed with the following 5 attributes (in that order):
1. salto_id: the Salto ID
2. zendesk_title: The actual title of the configuration in Zendesk
3. division: The division that owns the configuration
4. salto_url: The URL to access the configuration in Salto
For more information on .nacl files, here is a link to the documentation on .nacl syntax: https://github.com/salto-io/salto/blob/main/docs/user_guide.md#nacl-case.
1. The Salto ID (salto_id)
This ID can be found by opening the file and finding the string of text that follows "zendesk.macro" up until the "{" character on the first line. In the example above, the salto_id is: "SRD__FAQs__test_macro@ffffs".
2. The actual title of the configuration in Zendesk (zendesk_title)
This title can be found by locating the value of the "raw_title" attribute in the .nacl file. In the example above, the zendesk_title is: "SRD::FAQs::test macro".
3. the division that owns the configuration (division)
The division that owns the configuration can be found by parsing the zendesk_title and extracting the first string that occurs before the first "::". In the example above, the division is: "SRD". If there is no "::" in the zendesk_title, that this configuration doesn't belong to a particular division. So in that case, the division can be left blank.
4. The URL to access the configuration in Salto (salto_url)
The URL can be constructed by using the salto_id in conjunction with the Salto organization ID (org_id) and the Salto environment id (env_id). In the example above, assuming the that org_id is 6beb4cab-b3c4-40bb-b181-20e4c49e83a2 and the env_id is a5236736-1be2-4b67-be5c-6883e6a6439d, the salto_url is https://app.salto.io/orgs/6beb4cab-b3c4-40bb-b181-20e4c49e83a2/envs/a5236736-1be2-4b67-be5c-6883e6a6439d/explore?element=zendesk.macro.instance.SRD__FAQs__test_macro@ffffs.
Provide a Python script that will look inside a folder at all the nacl files (assume that all nacl files are in a single folder. so you can provide a path to that folder.) and generate a csv file that lists each configuration with its division first, then the zendesk_title, then the salto_url, and then the salto_id
Here's the script I sent to the customer after some tweaking:
They were able to run this script and after sharing the output, we formatted the final spreadsheet for them to review with their internal devisions. In hindsight, I could have combined these two into a single sheet that marks a particular macro for having a missing reference.
By using Salto, ChatGPT and Git, we were able to automate the process that otherwise would take their team weeks to accomplish—or would eventually translate into technical debt that blocks their customer support from staying more agile and effective.
You're welcome to try this hack if you have hundreds of Zendesk macros that you need to clean up. You will be able to do that with Salto's free trial! If you want to see Salto in action and chat with Salto experts, get in touch with us.