Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to make Insight API calls containing multiline values?

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

0 votes
Answer accepted

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'

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Atlympic Event: Jira Service Managemnt

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

123 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you