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

cURL PUT WI - RTC 4.0.3 (State Transition)

  Hello

Goal : Update the state of a Build WI 
State Flow : Ready For Build  (com.hcsc.team.workitem.buildWorkflow.state.s1) -> Dev (com.hcsc.team.workitem.buildWorkflow.state.s2) -> Pending UAT Approval (com.hcsc.team.workitem.buildWorkflow.state.s3)
Issue : cURL PUT update defaulting to Ready For Build  (com.hcsc.team.workitem.buildWorkflow.state.s1).

0 votes



One answer

Permanent link
Kartik,
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,
Simon

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
× 10,941
× 1,706

Question asked: Feb 07 '14, 2:43 p.m.

Question was seen: 5,699 times

Last updated: Feb 11 '14, 10:01 p.m.

Confirmation Cancel Confirm