The CreatorCon Call for Content is officially open! Get started here.

Incident description formatting inconsistent between environments

jimdawson
Giga Contributor

I am using a REST method to create incidents. In my development environment the 'description' field is formatted correctly but in the production environment linefeeds are either being stripped or ignored, e.g.:

DEV:

Line1
Line2
Line3

PROD:

Line1 Line2 Line3

I'm using newline characters ('\n') in the description feeds. Is there something I should be looking for that would cause the text formatting to be different between environments and/or is there a different way I should be formatting the description field?

Thanks in advance.

3 REPLIES 3

Weird
Mega Sage

Really hard to say without any examples.
Can you provide some logs? What are you receiving in both dev and prod.

Are you directly inserting into the table or do you use an import set table in between?

SN shouldn't have issues with \n, but along the way you might be parsing it out of the message you send to the production side. For example any 3rd party integration tool might be setup incorrectly towards the prod side.

jimdawson
Giga Contributor

I'm making a REST POST call on the 'incident' table. (no import set table)

The method payload is as follows: (italicized red fields are variables, some fields are omitted) 

Description = "Line1 \nLine2 \nLine3 \n";

{
        "priority": pri,
        "state": state,
        "short_description": Title,
        "assignment_group": AssignmentGroup,
        "description": Description,
        "impact": impact,
        "urgency": urgency,
        "caller_id": callerid,
        "contact_type": 'email',
        "cmdb_ci":cmdbci,
        "location":location_id,
 
        ...       
};
 
Content-type: application/json
Accept: application/json
 
I have tried changing the formatting to '\r\n' with a result of getting extraneous blank lines in dev but no change in prod.
 
What logs would you need?

 

Based on the content there should be no issues.

Can you send the exact same message to both PROD and DEV and see whether DEV still handles it properly?

If it does, I'd then check the incident tables business rules on both PROD and DEV. Are there any differences? Has someone made any changes on PROD side only?

For logging it might be worth checking the response you get from sending the message and then on the target instance if the logs start generating anything when the message is received.