Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
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

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 26 '11, 6:56 a.m.

Question was seen: 4,965 times

Last updated: Sep 26 '11, 6:56 a.m.

Confirmation Cancel Confirm