Need help updating a Workitem via OSLC
Hello,
I'm trying to write a Java OSLC client to read/write and update Workitem. I can read workitems fine but I'm having difficulties updating them.
This is what I'm doing; for instance I want to update the workitem title:
- Do a GET to retrieve the workitem title.
- Do a PUT with a defined header "IF-MATCH" with the ETAG retrieved in the GET previously.
The PUT looks something like below. Obviously I'm doing something wrong as I'm getting an INVALID URI. How can I specify updated properties such as title?
Thank you for guiding me.
I'm trying to write a Java OSLC client to read/write and update Workitem. I can read workitems fine but I'm having difficulties updating them.
This is what I'm doing; for instance I want to update the workitem title:
- Do a GET to retrieve the workitem title.
- Do a PUT with a defined header "IF-MATCH" with the ETAG retrieved in the GET previously.
The PUT looks something like below. Obviously I'm doing something wrong as I'm getting an INVALID URI. How can I specify updated properties such as title?
https://localhost:9444/jazz/oslc/contexts/_KOF8MAwqEd-ai4wmUH0wzw/workitems?oslc_cm.properties=dc:title <oslc_cm:ChangeRequest xmlns:dc="http://purl.org/dc/terms/"xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"> <dc:title>New Title</dc:title> </oslc_cm:ChangeRequest>
Thank you for guiding me.
6 answers
Hello,
Is there RTC client for AIX available for download ?
Specifically I am interested in RTC command line tools ( scm ) for AIX.
These command lines tools are in included in the RTC client for Windows and Linux.
I could not find these tools for AIX in the RTC download area.
I plan to use it on AIX 6.1
Appreciate your help.
Udaya
Is there RTC client for AIX available for download ?
Specifically I am interested in RTC command line tools ( scm ) for AIX.
These command lines tools are in included in the RTC client for Windows and Linux.
I could not find these tools for AIX in the RTC download area.
I plan to use it on AIX 6.1
Appreciate your help.
Udaya
I'm trying to write a Java OSLC client to read/write and update
Workitem. I can read workitems fine but I'm having difficulties
updating them.
This is what I'm doing; for instance I want to update the workitem
title:
- Do a GET to retrieve the workitem title.
- Do a PUT with a defined header "IF-MATCH" with the ETAG
retrieved in the GET previously.
The PUT looks something like below. Obviously I'm doing something
wrong as I'm getting an INVALID URI. How can I specify updated
properties such as title?
https://localhost:9444/jazz/oslc/contexts/_KOF8MAwqEd-ai4wmUH0wzw/workitems?oslc_cm.properties=dc:title
oslc_cm:ChangeRequest
xmlns:dc="http://purl.org/dc/terms/"xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"
dc:title>New Title</dc:title
/oslc_cm:ChangeRequest
The URL that you are PUTing to is the query URL, which explains the
Invalid URI error.
When you GET a work item, e.g. like
GET
https://server:port/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/123
You have to PUT the new contents back to the same URL.
Otherwise it looks good to me.
--
Regards,
Patrick
Jazz Work Item Team
Thanks Patrick but I still don't understand. What do you mean by "You have to PUT the new contents back to the same URL?"
Let's say I get a workitem with the URL : "https://localhost:9444/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/18"
How does the PUT url should look like to update for instance the workitem title?
Thanks for your help.
Let's say I get a workitem with the URL : "https://localhost:9444/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/18"
How does the PUT url should look like to update for instance the workitem title?
Thanks for your help.
Thanks Patrick but I still don't understand. What do you mean by
"You have to PUT the new contents back to the same URL?"
Let's say I get a workitem with the URL :
"https://localhost:9444/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/18"
How does the PUT url should look like to update for instance the
workitem title?
You would create a PUT request in your HttpClient for the URL:
https://localhost:9444/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/18
The If-Match header contains the eTag from the previous GET request
The body of the PUT request contains
<oslc_cm>
<dc>New Title</dc>
</oslc_cm>
And the content type for the body needs to be
application/x-oslc-cm-change-request+xml
--
Regards,
Patrick
Jazz Work Item Team
I have an AbstractService subclass that intercepts save operations, and in my debugging I'd like to generate the URL for the work item given by the ISaveParameter.getNewState(). For example, something like this:
https://localhost:7443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/10
Any tips on how to generate the URL for the IWorkItem returned by ISaveParameter.getNewState()?
Thanks!
https://localhost:7443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/10
Any tips on how to generate the URL for the IWorkItem returned by ISaveParameter.getNewState()?
Thanks!