Rest API for Updating WI Linktypes
We are working to link the GitHub Commit & Pull Request Link Types to ALM Work Item through Rest API Call. We are getting the error saying "No Project Area Set".
Rest API:
Server URL +"/service/com.ibm.team.workitem.common.internal.rest.IWorkItemRestService/workItem2
Inputs As Per Request Tab in the Browser Console
{
"itemId": "_Ql44IfU7Ee2lmP5eKuZ9Tw",
"type": "task",
"stateId": "_Jb358vVmEe2lmP5eKuZ9Tw",
"updateLinks": "{\"cmd\":\"addLink\",\"type\":\"com.ibm.team.workitem.linktype.trackedworkitem\",\"end\":\"target\",\"name\":\"Contributes To\",\"comment\":\"298015: Story WI ifix022\",\"uri\":\"https://rb-alm-05-q.de.bosch.com/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/298015\"}",
"additionalSaveParameters": [
"com.ibm.team.workitem.common.internal.updateExtendedRichText2",
"com.ibm.team.workitem.common.internal.updateBacklinks"
],
"sanitizeHTML": "true",
"projectAreaItemId": "_6BpyIAJhEeeOTILaMRLo0Q",
"projectAreaConfigurationStateId": "_ZQXEov6hEe2lEZlwEQROeA",
}
Error from Plain Java :
com.ibm.team.repository.common.transport.TeamServiceException: CRJAZ2942E A request from this server to another server could not be completed. The other server returned a 400 HTTP error with this error text: Bad Request.
Caused by: java.lang.IllegalArgumentException: No project area set
One answer
The API you are trying to use is an internal API (as can be seen in the internal in the URL). You are not supposed to use it. The error message suggests that the information about a project area is missing.
The Java API is supported.
The other public APIs e.g. OSLC can be found here: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding