Why the error 500 is retrieved when submitting a PATCH request to update an existing idea through Open API?
Issue Description: When trying to edit an existing idea through Open API in order to modify one of it's fields, error 500 is returned ("There was a server error").
Resolution:
One of the reasons for encountering this error is that the entire response from the GET call is used in the payload for the PATCH call. Not all of the details are required, breaking the schema when it is used this way.
Below is a sample of a valid payload format for the PATCH call. Find the required section under user_inputs in the response section of the GET call.
{
"user_inputs": {
"OVR": {
"ah-section-ovr-0-0": {
"OVR-OVERVIEW_NAME": {
"value": "Sample input"
},
"OVR-OVERVIEW_AUTO_GENERATED_ID": {
"value": "Sample input"
},
"OVR-OVERVIEW_AUTOMATION_ID": {
"value": "Sample input"
},
"OVR-OVERVIEW_DESCRIPTION": {
"value": "Sample input"
},
"OVR-SOLUTION": {
"value": [
"ah-answer_option-1673969089372-781d8aae-f32b-4f8f-9d1d-8ec5d3be79ae"
]
},
"OVR-OVERVIEW_CATEGORY": {
"value": 1
},
"OVR-OVERVIEW_PAIN_POINTS": {
"value": "Sample input"
},
"OVR-OVERVIEW_NEGATIVE_IMPACT": {
"value": "Sample input"
},
"OVR-OVERVIEW_TAGS": {
"value": "Sample input"
},
"OVR-OVERVIEW_USEFUL_LINK": {}
}
},
"Q1": {
"ah-section-q1-0-0": {
"Q1-HOURS_SAVED": {
"value": 1
},
"Q1-VOLUME": {
"value": 1
},
"Q1-DECISIONS_STRAIGHTFORWARD_RULES": {
"value": "ah-answer_option-q1-0-1-0-0"
},
"Q1-INPUT_DATA_ACCESSED_DIGITALLY": {
"value": "ah-answer_option-q1-0-1-1-0"
},
"Q1-DATA_HIGHLY_FORMATTED": {
"value": "ah-answer_option-q1-0-1-2-0"
},
"Q1-NO_EXPECTED_CHANGES": {
"value": "ah-answer_option-q1-0-1-3-0"
},
"Q1-PROCESS_DOCUMENTS": {
"value": [
"ah-answer_option-q1-0-1-4-0"
]
}
},
"ah-section-q1-0-1": {
"Q1-OVERALL_GAUGE_SCORE": {},
"Q1-READINESS_SCORE": {},
"Q1-SUITABILITY_SCORE": {},
"Q1-OVERALL_SCORE": {}
}
},
"MISC": {
"ah-section-misc-0-0": {
"MISC-MISC_EXPECTED_BENEFITS": {
"value": "Sample input"
},
"MISC-MISC_ACTUAL_BENEFITS": {
"value": "Sample input"
}
},
"ah-section-misc-0-1": {
"MISC-MISC_EXPECTED_CHALLENGES": {
"value": "Sample input"
},
"MISC-MISC_ACTUAL_CHALLENGES": {
"value": "Sample input"
}
},
"ah-section-misc-0-2": {
"MISC-MISC_LESSONS_LEARNED": {
"value": "Sample input"
}
},
"ah-section-misc-0-3": {
"MISC-MEDIA": {
"value": "Sample input"
}
},
"ah-section-misc-0-4": {
"MISC-MISC_SIMILAR_AUTOMATIONS": {
"value": "Sample input"
}
}
}
}
}