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

Issue with deserializing JSON for Jira REST API call

Vasanta Kumaar March 28, 2024

I'm currently encountering an issue while trying to create a Jira issue via the Jira Service Management (JSM) REST API. Previously, my code was working fine, but now I'm getting an error related to deserializing JSON data.

Here's the JSON data I'm trying to send:

{
"serviceDeskId": 10,
"requestTypeId": 79,
"requestFieldValues": {
"summary": "Distribution list modification",
"description": "Test",
"customfield_13108": {
"value": "Szczecin"
}
},
"requestParticipants": "mwysocki"
}

And here's the error message I'm receiving:

"Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@3dd96618; line: 10, column: 6]"
 

It seems like the error is related to the requestParticipants field, but I'm unsure why it's occurring, especially since a similar JSON structure worked before without issues.

Any insights into what might be causing this issue or suggestions on how to resolve it would be greatly appreciated!

Thank you!

 

1 answer

1 accepted

1 vote
Answer accepted
Ryan Manus
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2024

Hello, @Vasanta KumaarCovered California

 

I can see your query please see below and follow the information step by step.

 

The error message you’re receiving indicates that the requestParticipants field is expected to be an array (a java.util.ArrayList), but a string is being provided instead. To resolve this issue, you should modify the requestParticipants field to be an array of strings, even if there is only one participant. Here’s how you can adjust your JSON payload:

{
"serviceDeskId": 10,
"requestTypeId": 79,
"requestFieldValues": {
"summary": "Distribution list modification",
"description": "Test",
"customfield_13108": {
"value": "Szczecin"
}
},
"requestParticipants": ["mwysocki"]
}

 

By changing "requestParticipants": "mwysocki" to "requestParticipants": ["mwysocki"], you’re providing an array with a single string element, which should align with the expected data type and resolve the deserialization error.

 

If you continue to experience issues, please tell me I am happy to help you.

 

Best Regard,
Ryan Manus

Vasanta Kumaar March 28, 2024

Hi Ryan Manus, 

Yes, I tried it and it worked. However, for the past 5-6 months, we were successfully passing the value without brackets.

May I know why suddenly we are getting error.

Thanks,

Vasanta

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events