Unable to add Change Note in html format via Freshservice v2 API

I am trying to create a change note in Freshservice using the v2 API. The change note contains html tags (<br> and <div> tags). However, during creation, it seems the content is being sanitized and all the tags are removed except the first <div> and last </div> tags.

API URL: {{ _.FS_API_V2_URL}}/changes/2/notes

API Payload:

{
	"body": "<div>Test</div>\n<div><br></div>\n<div>Test</div>\n<div><br></div>\n<div>Test</div>\n"
}

After it is saved, the same change note is retrieved as follows:

{
	"note": {
		"id": 510282,
		"created_at": "2022-07-13T03:37:57Z",
		"updated_at": "2022-07-13T03:37:57Z",
		"body": "<div>Test\n\nTest\n\nTest\n</div>",
		"body_text": "Test\n\nTest\n\nTest",
		"user_id": 5155045,
		"notify_emails": null
	}
}
1 Like

@Dan,
Good Day! Welcome to the community

Due to security constrains, Product will sanitized the HTML which you sent via API, there is no other workaround for the same.

Hope it helps :slight_smile:

Thanks

Hello @Santhosh,

In that case, is there a way I can add new lines in the Change Note using the API ?

My use case is to add new lines to the Change Note to have separate paragraph texts. However, I am unable to do that using either <br> html tags or \n character.

Thanks

Hi @Dan,

can you try with <div><div>test</div> <div>test data</div> </div> like this ?

@Santhosh

Tried with the following request payload. It is not working.

{
	"body": "<div><div>test</div> <div>test data</div> </div>"
}

Getting the below response.

{
	"note": {
		"id": 510282,
		"created_at": "2022-07-14T17:54:49Z",
		"updated_at": "2022-07-14T17:54:49Z",
		"body": "<div>test test data </div>",
		"body_text": "test test data",
		"user_id": 5155045,
		"notify_emails": null
	}
}

@Dan,
Good Day!
Let me check with the team and get back to you at the earliest.

Thanks

@Vinoth_Christofer can you please help here?

1 Like

Is there ay update towards this? This would be a very important topic overall.

Hi @Fabian_Arlt . I’m afraid that this is a product limitation in the Change entity.

@Tanmay_Kapoor please take care of taking this up with the product team, as this is possible in Tickets but not in Changes.

1 Like

Hi,

Is there any solution or workaround for this ?

More help from Freshservice. Ask a question they can’t answer and they blow you off.

Hello @DisconentFSuser

I understand that @Vinoth_Christofer above has admitted to a product limitation as part of this topic, and recommended asking the respective product teams about considering addressing this gap. I also note there has been no workaround provided for this - I believe none is available today.

Do you mind helping us see where there was a blowing off of someone? I am happy to correct that if we acted in an inappropriate manner on this community.