Skip to main content
Question

JSON Line Breaks

  • December 14, 2024
  • 2 replies
  • 37 views

Forum|alt.badge.img+10

I am trying to update the description on a ticket via API call.  The description will be multiple lines though.  I cannot get the JSON formatted to be multiple lines though.

Also, of note, the use case is creating child tickets in Onboarding and I need the description in the newly created child ticket to be like the inherently created child tickets in the Onboarding module.  

 

 

Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+5
  • Skilled Expert
  • 15 replies
  • February 20, 2025

Hi Shannon!  Not sure if you got this figured out, but I figured I’d share anyway.  We have a ton of fields that are captured from our hiring manager, so I couldn’t stand the default layout of the description on the onboard/offboarding tickets.  I haven’t finished the onboarding ticket yet, but here’s what I have for my offboard:

{
  "ticket": {
    "description": "<h3><strong>Offboard - {{ticket.lf_user_to_onboardoffboard | sanitize_html}} - {{ticket.offboarding_request.actor_1.cf_employee_s_last_day_and_time_pacific | sanitize_html}}</strong></h3><p><br /><strong>Work Details</strong></p><ul><li><strong>Location</strong>: {{ticket.offboarding_request.actor_1.cf_employee_s_location | sanitize_html}}</li><li><strong>User's Manager</strong>: {{ticket.lf_employees_manager | sanitize_html}}</li><ul><li><strong><em>NOTE</em></strong>: If the user does not have a manager listed in AD, this will be populated with who entered the offboard ticket. If so, please update the ticket with the correct manager.</li></ul><li><strong>Mailbox Access To</strong>: {{ticket.lf_mailbox_access_to | sanitize_html}}</li><li><strong>Forward Emails To</strong>: {{ticket.lf_forward_emails_to | sanitize_html}}</li><li><strong>Asset</strong>: {{P4.root.assets.assets_object.name | sanitize_html}}</li></ul><p><strong>Personal Details</strong></p><ul><li><strong>Address</strong>: {{ticket.offboarding_request.actor_1.cf_personal_home_address | sanitize_html}}</li><li><strong>Email Address</strong>: {{ticket.offboarding_request.actor_1.cf_personal_email_address | sanitize_html}}</li><li><strong>Phone Number</strong>: {{ticket.offboarding_request.actor_1.cf_personal_phone_number | sanitize_html}}</li></ul>"
  }
}

 


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

Yes HTML works in the description field. 

Sometimes I create a note or format a description inside Fresh and use API to get the HTML code. Replace the text that is dynamic with placeholders. 


Reply