It's all about the answers!

Ask a question

cURL PUT WI - RTC 4.0.3 (State Transition)

Kartik Manchanda (767) | asked Feb 07 '14, 2:43 p.m.
edited Feb 11 '14, 10:01 p.m.

Goal : Update the state of a Build WI 
State Flow : Ready For Build  ( -> Dev ( -> Pending UAT Approval (
Issue : cURL PUT update defaulting to Ready For Build  (

One answer

permanent link
Simon Washbrook (67216) | answered Feb 10 '14, 10:23 a.m.
When I was doing updates to work items. i need to collect the "ETag" field from the headers and feed it back during the PUT.
i.e. Extract the ETag filed from the headers returned by the GET:

ETag=`grep ETag header.txt | sed -e 's/ETag: //' | sed -e 's/"//g'`

Then pass it has a value to the header "If-Match", you can add the following option tot he curl command line for the PUT.
 -H "If-Match: $ETag

The ETag field contains the last modified date of the work item so the work item will only be updated if it wasn't updated between the GET and the PUT. You need to manage this in your script, i.e. if you get an error during the PUT you need to perform the GET and again the PUT to update the work item.

I hope this helps,

Your answer

Register or 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.