How to set value of custom field programtically

Avec réponse

2 Commentaires

  • Lester
    Actions pour les commentaires Permalien

    Hey Eddie.

     

    I may be over complicating this, but this is what I did in the past.

     I have a Dynamic Content function that determines  the value of the source field and the relevant value of the destination field.

     

    {% case ticket.ticket_field_360000016364 %}       

    {% when 'athera_product1' %}

    orange

    {% when 'athera_product2' %}

    peach

    {% when 'athera_product3' %}

    pear

    {% when 'athera_product4' %}

    apple

    {% endcase %}

     

    I have a trigger that sets the field to the value obtained from the Dynamic Content function via a notify target.

     

    {         

    "ticket":

           {

                                                   

                                                    "custom_fields": [{"id":28219891,"value":"{{dc.athera_product_mapping}}"}]

           }      

    }

     

    So, if 360000016364 = athera_product1 then 28219891 is set to orange. 

    Hope that makes sense.

    0
  • Brett - Community Manager
    Actions pour les commentaires Permalien

    @Lester thanks for sharing this solution!

    @Eddie I believe Lesters comment will be the best option for setting your custom field value programatically.

    I'll leave this post open to see if other members of the community want to jump in and offer up an alternative.

    Cheers!

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk