WorkItem update from ZOS using CURL
Hello,
Im stuck when I try to update a RTC workitem from a Curl ZOS command (running trough the BPXBATSL program).
I try to follow : https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Examples
Here are my steps :
1) signon :
PGM /usr/lpp/ported/bin/curl
-v -k -L -c /tmp/cookies.txt
https://xx.xx.xxx.xx:9443/jazz/authenticated/identity
PGM /usr/lpp/ported/bin/curl
-v -k -L -b /tmp/cookies.txt -c /tmp/cookies.txt
-d j_username=toto -d j_password=toto
https://xx.xx.xxx.xx:9443/jazz/j_security_check
2) get the workitem in xml format
PGM /usr/lpp/ported/bin/curl
-v -k -L -b /tmp/cookies.txt -c /tmp/cookies.txt
-H "Accept:application/x-oslc-cm-change-request+xml"
-H "Content-Type:application/x-oslc-cm-change-request+xml"
https://xx.xx.xxx.xx:9443/jazz/oslc/workitems/3584.xml?oslc_cm.properties=dc:essai
3) put the workitem
PGM /usr/lpp/ported/bin/curl
-D - -k -v -L -b /tmp/cookies.txt
-H "accept:application/x-oslc-cm-change-request+xml"
-H "Content-Type:application/x-oslc-cm-change-request+xml"
-X PUT
-d /SYSTEM/tmp/toto.xml
https://xx.xx.xxx.xx:9443/jazz/oslc/workitems/3584.xml?oslc_cm.properties=dc:essai
When I ran the PUT, the workitem is not updated at all.
The user defined property essai has the value not assigned (even if there was another value before)
It seems to me that all data in the file toto.xml are ignored.
I try the same put with the firefox addon for REST and it worked.
Any ideas ?
Thanks.
Im stuck when I try to update a RTC workitem from a Curl ZOS command (running trough the BPXBATSL program).
I try to follow : https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Examples
Here are my steps :
1) signon :
PGM /usr/lpp/ported/bin/curl
-v -k -L -c /tmp/cookies.txt
https://xx.xx.xxx.xx:9443/jazz/authenticated/identity
PGM /usr/lpp/ported/bin/curl
-v -k -L -b /tmp/cookies.txt -c /tmp/cookies.txt
-d j_username=toto -d j_password=toto
https://xx.xx.xxx.xx:9443/jazz/j_security_check
2) get the workitem in xml format
PGM /usr/lpp/ported/bin/curl
-v -k -L -b /tmp/cookies.txt -c /tmp/cookies.txt
-H "Accept:application/x-oslc-cm-change-request+xml"
-H "Content-Type:application/x-oslc-cm-change-request+xml"
https://xx.xx.xxx.xx:9443/jazz/oslc/workitems/3584.xml?oslc_cm.properties=dc:essai
3) put the workitem
PGM /usr/lpp/ported/bin/curl
-D - -k -v -L -b /tmp/cookies.txt
-H "accept:application/x-oslc-cm-change-request+xml"
-H "Content-Type:application/x-oslc-cm-change-request+xml"
-X PUT
-d /SYSTEM/tmp/toto.xml
https://xx.xx.xxx.xx:9443/jazz/oslc/workitems/3584.xml?oslc_cm.properties=dc:essai
When I ran the PUT, the workitem is not updated at all.
The user defined property essai has the value not assigned (even if there was another value before)
It seems to me that all data in the file toto.xml are ignored.
I try the same put with the firefox addon for REST and it worked.
Any ideas ?
Thanks.
One answer
Hello,
You should have a HTTP retun code when the put fails, and an error message. It would help to diagnose the problem.
Have you retrieved the ETag when you do the get to use it during the update ? Otherwise you would obtain an error (412 if I remember correctly).
I have also seen errors due to the user involved not having the licence to update the work-item. This happened due to using the wrong case for the userid when the user registry is case sensitive.
There are several articles on the topic on jazz.net, such as https://jazz.net/library/article/352
Regards,
Nicolas
You should have a HTTP retun code when the put fails, and an error message. It would help to diagnose the problem.
Have you retrieved the ETag when you do the get to use it during the update ? Otherwise you would obtain an error (412 if I remember correctly).
I have also seen errors due to the user involved not having the licence to update the work-item. This happened due to using the wrong case for the userid when the user registry is case sensitive.
There are several articles on the topic on jazz.net, such as https://jazz.net/library/article/352
Regards,
Nicolas