Highlighted
Honored Contributor.
Honored Contributor.
611 views

JSON for Array fields (description, solution...)

Hi Experts,

I need your help please.
I am testing the integration between 2 SM applications using REST API.

I can successfully create ticket from 1 application to another.

However I am facing an issue with the description field or the $update.action or solution fields.
What I am trying to do is to create/update a ticket B in SM2 from a ticket A in SM1 & it will copy all the fields from ticket A to Ticket B. 
All the fields are populating properly, except the array fields like description.  I am using JSON.stringify() in my script in order to convert it to string. However the description field in ticket B is displayed in a different way from Ticket A.
For example:
Ticket A Description is the following:
Test

Test2

Ticket B the description is displayed like this:
{"0":"Test","1":null,"2":"Test2"}

my question is, how can I display the description field in Ticket B the same way in Ticket A?

Please I need your help.

Thanks

0 Likes
2 Replies
Highlighted
Micro Focus Contributor
Micro Focus Contributor

Hello ,

There is a document guide called : Service Manager Web services Guide

Document ID: KM01824642

Service Manager Web Services provide the ability to communicate and integrate with applications in an open and efficient manner. Web Services provide the ability to use a third-party application inside Service Manager, manipulate Service Manager data inside your custom application, or transfer data among separate Service Manager systems, so you can use this information to accomplish your requirements.

 

Let us know any kind of concerns you may have.

 

Best regards.

 

0 Likes
Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..

Assuming your using Service Manager 9.*

It's like that because your working with a DATUM vs an array.

What you could do is .toArray() the DATUM then convert it to a JSON and it should work as expected.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.