curl - "Could not update: Could not write changes in Unit Of Work" error when trying to update a user story Using the Rally Java Toolkit -


while trying update userstory in rally using java toolkit here: https://github.com/rallytools/rallyresttoolkitforjava getting "could not update" error using following code.

rallyrestapi restapi = new rallyrestapi(new uri(rally_uri), rally_apikey); restapi.setwsapiversion("v2.0");jsonobject updateddefect = new jsonobject(); updateddefect.addproperty("c_proddeploydate", "20151405"); out.println(updateddefect.getasjsonobject()); updaterequest updaterequest = new updaterequest("https://us1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/24091008142", updateddefect.getasjsonobject()); updaterequest.setfetch(new fetch("name", "c_buildlink", "c_proddeploydate")); out.println(updaterequest.tourl()); out.println(updaterequest.getbody()); updateresponse updateresponse = restapi.update(updaterequest); out.println(arrays.tostring(updateresponse.geterrors())); out.println(updateresponse.wassuccessful()); 

this gives me following output:

{"c_proddeploydate":"20151405"} /hierarchicalrequirement/24091008142.js?fetch=name%2cc_buildlink%2cc_proddeploydate {"hierarchicalrequirement":{"c_proddeploydate":"20151405"}} [could not update: not write changes in unit of work] false 

based on question: rally webservices api v 1.36 <operationresulterror>could not update: not write changes in unit of work</operationresulterror> tried through curl no luck.

curl -x post -v --header "zsessionid:_apikey_omitted" -h "content-type: application/json" -d "{\"hierarchicalrequirement\":{\"c_proddeploydate\":"20151405"}}" https://us1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/24091008142 1>test.txt 2>test2.txt 

test.txt:

{"operationresult": {"_rallyapimajor": "2", "_rallyapiminor": "0", "errors": ["could not update: not write changes in unit of work"], "warnings": []}} 

test2.txt:

* adding handle: conn: 0x207d370 * adding handle: send: 0 * adding handle: recv: 0 * curl_addhandletopipeline: length: 1 * - conn 0 (0x207d370) send_pipe: 1, recv_pipe: 0   % total    % received % xferd  average speed   time    time     time  current                                  dload  upload   total   spent    left  speed    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connect() us1.rallydev.com port 443 (#0) *   trying 63.150.172.6... * connected us1.rallydev.com (63.150.172.6) port 443 (#0) * set certificate verify locations: *   cafile: c:\program files (x86)\git\bin\curl-ca-bundle.crt   capath: none * sslv3, tls handshake, client hello (1): } [data not shown] * sslv3, tls handshake, server hello (2): { [data not shown] * sslv3, tls handshake, cert (11): { [data not shown] * sslv3, tls handshake, server finished (14): { [data not shown] * sslv3, tls handshake, client key exchange (16): } [data not shown] * sslv3, tls change cipher, client hello (1): } [data not shown] * sslv3, tls handshake, finished (20): } [data not shown] * sslv3, tls change cipher, client hello (1): { [data not shown] * sslv3, tls handshake, finished (20): { [data not shown] * ssl connection using rc4-md5 * server certificate: *    subject: businesscategory=private organization; 1.3.6.1.4.1.311.60.2.1.3=us; 1.3.6.1.4.1.311.60.2.1.2=delaware; serialnumber=3413668; street=3333 walnut st.; postalcode=80301; c=us; st=colorado; l=boulder; o=rally software development corp; cn=rally1.rallydev.com *    start date: 2013-10-22 12:00:01 gmt *    expire date: 2015-06-03 12:00:00 gmt *    subjectaltname: us1.rallydev.com matched *    issuer: c=us; o=digicert inc; ou=www.digicert.com; cn=digicert sha2 extended validation server ca *    ssl certificate verify ok. > post /slm/webservice/v2.0/hierarchicalrequirement/24091008142 http/1.1  > user-agent: curl/7.30.0  > host: us1.rallydev.com  > accept: */*  > zsessionid:_apikey_omitted  > content-type: application/json  > content-length: 57  >   } [data not shown] * upload sent off: 57 out of 57 bytes < http/1.1 200 ok  < date: fri, 15 may 2015 04:11:39 gmt  < rallyrequestid: qd-app-141g7i6j3ih5r0c1s3315892wbdc.qd-app-1414588284  < expires: thu, 01 jan 1970 00:00:00 gmt  < content-type: text/javascript;  charset=utf-8  < content-length: 156  < set-cookie: jsessionid=qd-app-141g7i6j3ih5r0c1s3315892wbdc.qd-app-14;path=/;secure;httponly  < set-cookie: subbucketid=1;path=/;domain=us1.rallydev.com;secure;httponly  < vary: accept-encoding  < p3p: cp="non dsp cor cura psaa psda our nor bus pur com nav sta"  < cache-control: private,max-age=0,must-revalidate  < set-cookie: nsc_vt1.sbmmzefw.dpn!-!iuuqt=ffffffff09091c3845525d5f4f58455e445a4a42378b;path=/;secure;httponly  <   { [data not shown]  100   213  100   156  100    57    237     86 --:--:-- --:--:-- --:--:--   237 100   213  100   156  100    57    237     86 --:--:-- --:--:-- --:--:--   237 * connection #0 host us1.rallydev.com left intact 

i can't find official documentation server error, i'm stumped wrong. note apikey using has server write access.

i figured out mistake shortly after posting this. although rally did not return error regarding date formatting, problem. saw 20151405 valid iso8601 date, not specific form rally expects, "yyyy-mm-dd". changing line to:

updateddefect.addproperty("c_proddeploydate", "2015-14-05"); 

fixed problem.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -