Recherches récentes


Pas de recherche récente

Bulk Updating and adding a Tag in Macros



Publication le 25 janv. 2023

Hello Zendesk Devs! 

 

I am looking to update all 17K of the macros we have in our instance and am looking for a good way to do this. 

I've seen documentation on updating the description but what I'm looking for is:

  • a way to add the actions of "add a tag" and whatever tag I need associated with the particular Macro

Can anyone help me out with this? 


2

3

3 commentaire

Hi Axel,
 
The field to add tags is current_tags.  We have the full set of action fields and values in our Actions Reference for business rules.

0


I used the following in Postman to upload tags along with my macros and was not able to successfully add the values from my document when running my collection. 

 

{
  "macro": {
    "title": "{{macro_title}}",
    "active": true,
    "default": false,
    "actions": [
      {
        "field": "comment_mode_is_public",
        "value": {{comment_mode_is_public}}
      },
      {
        "field": "comment_value_html",
        "value": "{{comment_value_html}}"
      },
      {
        "field": "add_tags",
        "value": "{{tag}}"
      },
      {
        "field": "status",
        "value": "{{status}}"
      }
    ],

What should the proper “field" be in order to add the tags while bulk importing macros?

 

I was able to successfully bulk import using the following 

 

{
    "macro": {
        "title": "{{macro_title}}",
        "active": true,
        "default": false,
        "description": "{{description}}",
        "actions": [
            {
                "field": "comment_mode_is_public",
                "value": {{comment_mode_is_public}}
            },
            {
                "field": "comment_value_html",
                "value": "{{processed_comment_value_html}}"
            },
            {
                "field": "status",
                "value": "{{status}}"
            }
        ]
    }
}

 

But could never make it work when trying to include tags in the import. 

0


Hey Gabriel Ortiz. You'll likely need to leverage the Ticketing API to do this. I suggest a three step approach:

  1. Use the API to export all your macros to a csv file, remembering to include the 'id' field.
  2. Update the csv file with a new column that will contain the tag you want to add for each macro.
  3. Use the API to update your macros (using the csv file), setting the 'add_tags' action for each macro to be the tag value in the csv file. 

There's a list of API clients here that you could look at to get started, or you can write your own code.

1


Se connecter pour laisser un commentaire.

Vous ne trouvez pas ce que vous cherchez ?

Nouvelle publication