From 33df52214b5a72d4dc9e2de09aa40b477c2b617e Mon Sep 17 00:00:00 2001 From: Parikshit Singh Date: Tue, 5 Jan 2021 02:21:58 +0530 Subject: [PATCH 1/2] Update ticket_create_json.rb This PR shows how to add custom fields to the payload. --- Ruby/ticket_create_json.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Ruby/ticket_create_json.rb b/Ruby/ticket_create_json.rb index c0abee2..2693013 100644 --- a/Ruby/ticket_create_json.rb +++ b/Ruby/ticket_create_json.rb @@ -17,7 +17,10 @@ description: 'test ticket creation with attachments', subject: 'new ticket sample', cc_emails: ['myemail@testexample.com', 'test@testexample.com'], - email: 'test@test.com' }.to_json + email: 'test@test.com', + custom_fields: { cf_product_price: 20, + cf_product_color: 'green' } # Assuming tha there are two custom fields "Product Price" and "Product Color". + }.to_json freshdesk_api_path = 'api/v2/tickets' From 3972a9e9f76a1377b31448ea6edd31f068b0b12c Mon Sep 17 00:00:00 2001 From: Parikshit Singh Date: Tue, 20 Apr 2021 06:47:38 +0530 Subject: [PATCH 2/2] Update ticket_create_json.rb --- Ruby/ticket_create_json.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ruby/ticket_create_json.rb b/Ruby/ticket_create_json.rb index 2693013..61d77c5 100644 --- a/Ruby/ticket_create_json.rb +++ b/Ruby/ticket_create_json.rb @@ -19,7 +19,7 @@ cc_emails: ['myemail@testexample.com', 'test@testexample.com'], email: 'test@test.com', custom_fields: { cf_product_price: 20, - cf_product_color: 'green' } # Assuming tha there are two custom fields "Product Price" and "Product Color". + cf_product_color: 'green' } # Assuming that there are two custom fields "Product Price" and "Product Color". }.to_json freshdesk_api_path = 'api/v2/tickets'