The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Insight API calls containing multiline values?

Koczka Bence
Contributor
June 17, 2021

I am writing an application which makes many generated  API calls, to update Insight fields.
Many values I am updating are multiline strings, like this one:


{
"objectTypeId": 678,
"attributes": [
{
"objectTypeAttributeId": 2759,
"objectAttributeValues": [
{
 "value": "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\address
C:\Windows
C:\
E:\
C:\ExchangeSetupLogs
C:\Windows\SYSVOL\sysvol\ritestkobe.local\SCRIPTS
C:\Windows\SYSVOL\sysvol"
}
]
}
]
}

 There are several other requests like this, containing many and more lines.

The problem is, a request containing a value with multiple lines is returning an internal server error.

Is there anyway to post multiline values to Insight objects through the API? If not, I would really appreciate any suggestions to solve this issue.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 18, 2021

I suspect the \ in your string are as much a problem as the carriage returns

Try this

{
"objectTypeId": 678,
"attributes": [
{
"objectTypeAttributeId": 2759,
"objectAttributeValues": [
{
"value": "C:\\\\Program Files\\\\Microsoft\\\\Exchange Server\\\\V15\\\\Mailbox\\\\address
C:\\\\Windows
C:\\\\
E:\\\\
C:\\\\ExchangeSetupLogs
C:\\\\Windows\\\\SYSVOL\\\\sysvol\\\\ritestkobe.local\\\\SCRIPTS
C:\\\\Windows\\\\SYSVOL\\\\sysvol"
}
]
}
]
}

 If that doesn't quite work, put the string all in one line and separate them with '\\n'

TAGS
AUG Leaders

Atlassian Community Events