and more in a single search tool across platforms. Read the announcement here. |
03/15/2024 08:20 AM - edited 03/17/2024 12:10 AM
Hi all,
I am working on the Fresh service Ticketing system.
I have created a ticket in Fresh service UI and have got the ticket details using Postman.
Ticket at Freshservice UI:
Ticket Details in Postman response [GET]:
{
"ticket": {
"planned_start_date": null,
"planned_end_date": null,
"planned_effort": null,
"subject": "Test Ticket for Phoenix from UI",
"group_id": 29000276797,
"department_id": 29600116854,
"category": null,
"sub_category": null,
"item_category": null,
"requester_id": 29061507158,
"responder_id": null,
"due_by": "2024-03-22T21:00:00Z",
"fr_escalated": false,
"deleted": false,
"spam": false,
"email_config_id": null,
"fwd_emails": [],
"reply_cc_emails": [],
"cc_emails": [],
"is_escalated": false,
"fr_due_by": "2024-03-15T18:00:00Z",
"id": 14,
"priority": 1,
"status": 2,
"source": 13,
"created_at": "2024-03-13T08:13:30Z",
"updated_at": "2024-03-13T08:13:30Z",
"requested_for_id": 24081507158,
"to_emails": null,
"type": "Incident",
"description": "<div style=\"font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; font-size: 14px; \">\n<div dir=\"ltr\">\n<strong dir=\"ltr\">Name: </strong>Phoenix Account_1</div>\n<div dir=\"ltr\">\n<strong>Hire Date:</strong> 13th-March-2024 </div>\n<div dir=\"ltr\">\n<strong>Job Title:</strong> Digital Branch Manager</div>\n<div dir=\"ltr\">\n<strong>AD account name</strong>: STCU/AD accountname(Firstname.Lastname'1')</div>\n<div dir=\"ltr\">\n<strong>Branch/Dept:</strong> Digital Branch</div>\n<div dir=\"ltr\">\n<strong>Email Address:</strong> fnme.lname@phoenix.org</div>\n</div>",
"description_text": "Name: Phoenix Account_1 Hire Date: 13th-March-2024 Job Title: Digital Branch Manager AD account name: AD accountname(Firstname.Lastname'1') Branch/Dept: Digital Branch Email Address: fnme.lname@phoenix.org",
"custom_fields": {
"business_impact": null,
"impacted_locations": null,
"no_of_customers_impacted": null,
"major_incident_type": null
},
"workspace_id": 3,
"sla_policy_id": 28000089369,
"impact": 1,
"urgency": 1,
"bcc_emails": null,
"applied_business_hours": 29000015096,
"created_within_business_hours": false,
"resolution_notes": null,
"resolution_notes_html": null,
"attachments": []
}
}
Now, I am trying to create the ticket from Saviynt.
In the "httpparams" of CREATETICKETJSON, I need to pass same details in the Ticket's description field in the same format as shown in the above pic.
But, I am not able to bring the line break in the JSON.
I have used \n, \\n, \\\\n, <br> <br/> between the Username and Hiredate. But none of them worked.
CREATETICKETJSON:
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxservicedesk.freshservice.com/api/v2/tickets",
"httpMethod": "POST",
"httpParams": "{\"email\": \"abc@xyzenterprise.com\",\"description\": \"An Access Request has been submitted for ${user.lastname}, ${user. firstname}\\nHiredate:Newdate\",\"subject\": \"Access Request submitted for Application ${task.endpoint.endpointname}\", \"priority\": 1, \"status\": 2,}",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "ticket.id",
"unsuccessResponses": {
"message": "Failed"
}
}
]
}
As of now, I am able to pass the details in a single line in the Ticket's description if I don't use any of \n,\\n.
Could someone please suggest how to bring the line break in CREATETICKETJSON.
Thanks & Regards,
SaviyntSavvy
03/17/2024 06:24 PM
use \\\\n
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxxxservicedesk.freshservice.com/api/v2/tickets",
"httpMethod": "POST",
"httpParams": "{\"email\": \"abc@xyzenterprise.com\",\"description\": \"An Access Request has been submitted for ${user.lastname}, ${user. firstname}\\\\nHiredate:Newdate\",\"subject\": \"Access Request submitted for Application ${task.endpoint.endpointname}\", \"priority\": 1, \"status\": 2,}",
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "ticket.id",
"unsuccessResponses": {
"message": "Failed"
}
}
]
}