Adding custom attribute links via OSLC
The guidance on the wiki to me to the point where I could add links via the built in types without a problem. https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Adding_Links_to_a_Work_Item
Now I have added a custom attribute of type "Work Item List" that exposes the same sort of collection ref when fetched, but I get 405 errors with no message when I try to post a new link.
With a custom attribute:
Returns
So with a built in link type all is well.
Returns without error and the link is present on the WI.
Is this not currently supported ?
Submitted defect:
http://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=166515
-Sean
Now I have added a custom attribute of type "Work Item List" that exposes the same sort of collection ref when fetched, but I get 405 errors with no message when I try to post a new link.
With a custom attribute:
colURL = 'https://wincqserver:9445/rtc/oslc/workitems/2777/rtc_cm:com.ibm.rational.utl.request.attrib.otps'
linkJSON = '''{
"rdf:resource" : "https:\/\/wincqserver:9445\/rtc\/oslc\/workitems\/2774"
}'''
print( jazz.postJSON( colURL, linkJSON ) )
print ( jazz.getQueryResults(projectName, '?oslc_cm.query=dc:identifier=%222777%22&oslc_cm.properties=oslc_cm:relatedChangeManagement,rtc_cm:com.ibm.rational.utl.request.attrib.otps') )
Returns
{'accept': 'text/json',
'content-type': 'application/x-oslc-cm-change-request+json',
'cookie': 'JSESSIONID=D27D60C082F20F8F7829781EC43FE303; Path=/rtc; Secure, JazzFormAuth=Form; Path=/rtc'}
{
"oslc_cm:message": null,
"oslc_cm:status": 405
}
https://wincqserver:9445/rtc/oslc/contexts/_v-iPIIO2Ed-ec4_ZoGHE4w/workitems?oslc_cm.query=dc:identifier=%222777%22&oslc_cm.properties=oslc_cm:relatedChangeManagement,rtc_cm:com.ibm.rational.utl.request.attrib.otps
{"oslc_cm:results":[{"rdf:resource":"https:\/\/wincqserver:9445\/rtc\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/2777","rtc_cm:com.ibm.rational.utl.request.attrib.otps":[],"oslc_cm:relatedChangeManagement":[]}],"oslc_cm:totalCount":1}
So with a built in link type all is well.
colURL = 'https://wincqserver:9445/rtc/oslc/workitems/2777/oslc_cm:relatedChangeManagement'
linkJSON = '''{
"rdf:resource" : "https:\/\/wincqserver:9445\/rtc\/oslc\/workitems\/2774"
}'''
print( jazz.postJSON( colURL, linkJSON ) )
print ( jazz.getQueryResults(projectName, '?oslc_cm.query=dc:identifier=%222777%22&oslc_cm.properties=oslc_cm:relatedChangeManagement,rtc_cm:com.ibm.rational.utl.request.attrib.otps') )
Returns without error and the link is present on the WI.
{'accept': 'text/json',
'content-type': 'application/x-oslc-cm-change-request+json',
'cookie': 'JSESSIONID=D95481D785E69F1D43373094CB495FDD; Path=/rtc; Secure, JazzFormAuth=Form; Path=/rtc'}
{"rdf:resource":"https:\/\/wincqserver:9445\/rtc\/oslc\/workitems\/2774","oslc_cm:label":""}
https://wincqserver:9445/rtc/oslc/contexts/_v-iPIIO2Ed-ec4_ZoGHE4w/workitems?oslc_cm.query=dc:identifier=%222777%22&oslc_cm.properties=oslc_cm:relatedChangeManagement,rtc_cm:com.ibm.rational.utl.request.attrib.otps
{"oslc_cm:results":[{"rdf:resource":"https:\/\/wincqserver:9445\/rtc\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/2777","rtc_cm:com.ibm.rational.utl.request.attrib.otps":[],"oslc_cm:relatedChangeManagement":[{"rdf:resource":"https:\/\/wincqserver:9445\/rtc\/oslc\/workitems\/2774","oslc_cm:label":""}]}],"oslc_cm:totalCount":1}
Is this not currently supported ?
Submitted defect:
http://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=166515
-Sean