Hi Jason
I tried with the curl you provided, still it gives me below error and I am not able to update the description field
Below is the curl command I am using
curl -u pottic:July2019# -X PATCH "https://brg-jama-tst.state.mi.us/rest/latest/items/10276" -H "accept: application/json" -H "Content-Type: application/json" -H -d "[ { \"op\": \"replace\", \"path\": \"/fields/description\", \"value\": \"this is a test to update\" }]"
error is as below :
{"meta":{"status":"Bad Request","timestamp":"2019-07-26T18:06:13.089+0000","message":"the request violated certain constraints","violations":[{"message":"request body is required","constraint":"BODY_NOT_NULL"}]}}
curl: (3) [globbing] bad range specification in column 2
Thanks
Chaitanya
------------------------------
Chai P
aaa
------------------------------
Original Message:
Sent: 07-18-2019 18:07
From: Jason Ritz
Subject: Unable to update jama item using PUT rest api and curl
Hi Chai,
I was able to update the description of an item in swagger using the "PATCH /items/{id} endpoint and the op "replace". Here is the body I used:
[
{
"op": "replace",
"path": "/fields/description",
"value": "this is a test"
}
]
This gives the CURL:
curl -X PATCH "https://<URL>/rest/latest/items/<item#>" -H "accept: application/json" -H "Content-Type: application/json" -H "jama-csrf-token: <token>" -d "[ { \"op\": \"replace\", \"path\": \"/fields/description\", \"value\": \"this is a test\" }]"
If you replace the < > information, this should work for you.
Good luck!
Jason
------------------------------
Jason Ritz
Jama Software
OR
Original Message:
Sent: 07-18-2019 16:21
From: Chai P
Subject: Unable to update jama item using PUT rest api and curl
Hi
I tried with below curl command
curl --header "Content-Type: application/json" --header "Accept: application/json" -u pottic:July2019# -X PATCH --data "[ { \"op\": \"update\", \"path\": \"/fields\", \"value\": {\"description\":\"Test requirement for good XXX\"} }]" "https://brg-jama-tst.state.mi.us/rest/latest/items/10276"
Getting the below error
{"meta":{"status":"Bad Request","timestamp":"2019-07-18T20:19:37.323+0000","message":"No enum constant com.jamasoftware.contour.rest.versions.v1.domain.PatchOperation.UPDATE"}}
Kindly let me know how to resolve it
------------------------------
Chai P
aaa
Original Message:
Sent: 07-18-2019 12:57
From: Chloe Elliott
Subject: Unable to update jama item using PUT rest api and curl
Chai:
The error message indicates that you need to choose a CRUD (create, retrieve, update, delete) "op" included in your curl. Example:
"[ { \"op\": \"update\", \"path\": \"/fields\", \"value\": {\"description\":\"Test requirement for good\"} }]"
One way you could generate the right curls for your endpoints would be to generate them in Swagger. You could either use Swagger directly to run your curls or you can utilize it to generate the correct ones, per your needs and parameters, and then use the curl however you want.
Best,
------------------------------
Chloe Elliott
Jama Software
Portland OR
Original Message:
Sent: 07-18-2019 06:44
From: Chai P
Subject: Unable to update jama item using PUT rest api and curl
Hi
I am waiting for reply on updating using curl as PATCH as I am still getting error as posted above
------------------------------
Chai P
aaa
Original Message:
Sent: 07-17-2019 14:35
From: Chloe Elliott
Subject: Unable to update jama item using PUT rest api and curl
Chai:
Welcome to the Community!
You are going to want to use PATCH instead of PUT. PUT expects ALL fields to be updated and it looks like you are only updating one field.
Best,
------------------------------
Chloe Elliott
Jama Software
Portland OR
Original Message:
Sent: 07-17-2019 13:36
From: Chai P
Subject: Unable to update jama item using PUT rest api and curl
Hi
I am trying to update description filed for my item in jama using curl and PUT rest api. Below is the curl command I am using . I am using windows to use the CURL . The field has read write permission.I have admin access
curl -H "Content-Type: application/json" -u pottic:July2019# -X PUT --data "{\"project\":45,\"fields\": {\"name\":\"New requirement X\",\"description\":\"Test requirement for good\",\"systemprocess$128\":[514],\"systems_impacted$128\":[627],\"business_owner$128\":49},\"parent\":{\"item\":10275}}" "https://brg-jama-tst.state.mi.us/rest/latest/items/10276"
Error I am encountering
{"meta":{"status":"Bad Request","timestamp":"2019-07-17T17:25:34.677+0000","message":"You must set the following required fields. fields: systemprocess$128, systems_impacted$128, business_owner$128"}}
Kindly let me know how to pass the correct response so that I can update the description field using PUT and curl.
Thanks
------------------------------
Chai P
aaa
------------------------------