Skip to main content

Hello.

I get the following response when I try to create a Ticket (i.e. Service Record)

{
    "status": 500,
    "message": "java.util.LinkedHashMap cannot be cast to java.lang.String"
}

 

I’m doing a POST to the following endpoint: https://myurl/api/v1/sr?fields=id

The JSON Body that I’m sending is:

{
"info":
{
"key": "cust_list1",
"value": "3"
},
{
"key": "CustomColumn12sr",
"value": "7"
},
{
"key": "agreement",
"value": "1"
},
{
"key": "impact",
"value": "2"
},
{
"key": "priority",
"value": "4"
},
{
"key": "problem_type",
"value": "Solutions_SAP%20-%20Jobs"
},
{
"key": "CustomColumn19sr",
"value": "1"
},
{
"key": "update_user",
"value": "582"
},
{
"key": "submit_user",
"value": "582"
},
{
"key": "responsibility",
"value": "582"
},
{
"key": "request_user_name",
"value": "582"
},
{
"key": "request_user",
"value": "582"
},
{
"key": "CustomColumn15sr",
"value": "1"
},
{
"key": "account_id",
"value": "our_account_id"
},
{
"key": "sr_type",
"value": "1"
},
{
"key": "quick_name",
"value": "Test ticket, please ignore - 2024-02-19"
},
{
"key": "title",
"value": "Test ticket, please ignore - 2024-02-19"
},
{
"key": "source",
"value": "1"
},
{
"key": "CustomColumn18sr",
"value": "1"
},
{
"key": "project_id",
"value": {
"321": "PM Tool",
"311": "JSOX control execution",
"317": "User Access monitoring"
}
},
{
"key": "cust_int2",
"value": "0"
},
{
"key": "description",
"value": "The following SAP jobs failed on 2024-02-19, -WMS AUTO TRANSFER ORD 2 - WPSB] "
},
{
"key": "urgency",
"value": "5"
},
{
"key": "sub_type",
"value": "5"
},
{
"key": "department",
"value": "1"
},
{
"key": "CustomColumn7sr",
"value": "JOBLGX00071400X01548, JOBLGX23570201X64811, JOBLGX23581000X37707, "
}
]
}

 

Any help would be greatly appreciated

Rudy

 

 

Hi rgireyev,

So it appears that the error message you encounter might be due to the 'project_id' field. 

A correct value would look something like this for the project_id:

{
"key": "project_id",
"value": "321" // or the appropriate project ID as a string
}

Try to use a different value or the appropriate value for the project id and POST request again.

If you need more help, have further questions, or just want to chat about this topic, please don't hesitate to reach out. 

 


Thank you Stefan. That did the trick and I was able to create the Service Record.

However, I took the format for the project from the result of the SR retrieval.

Endpoint: https://myurl/api/v1/sr/12345678

Do you happen to know why it is returned in that format?

 

TIA

Rudy

 


Reply