How to set value of custom field programtically
RéponduI have created a ticket custom field and was wondering if I can set the value of this new field based on other existing ticket fields
I can see how custom fields can be used as conditions for triggers but can't see anywhere how to programmatically set these values
-
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.
-
@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!
Vous devez vous connecter pour laisser un commentaire.
2 Commentaires