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

Add timesheet by RTC REST API

  I try to use OSLC to add timesheet through the following code
public boolean addDairy(String startdate,float spentTime,String timeCode,String timeCodeId,String defectId,String userId){
String url=rtcBaseURL + "/oslc/workitems/"+defectId+"/rtc_cm:timeSheet/rtc_cm:entry";//rtcBaseURL is like"https://jazz.com:9443/ccm"
String workItem=rtcBaseURL + "/resource/itemName/com.ibm.team.workitem.WorkItem/" + defectId;
String creator =rtcBaseURL+"/jts/users/"+userId;
String spentTm=new DecimalFormat("#").format(spentTime*3600000);
String jsonComment = "{\"rtc_cm:workItem\":\"" + workItem + "\",\"dc:creator\":\""+creator+"\",\"rtc_cm:startDate\":\""+startdate+"\",\"rtc_cm:timeCode\":\""+timeCode+"\",\"rtc_cm:timeCodeId\":\""+timeCodeId+"\",\"rtc_cm:timeSpent\":\""+spentTm+"\"}";
JSONObject json = (JSONObject) post(url, jsonComment);
return true;
}

I use the code to add timesheet ,howerver it returns "HTTP/1.1 405 Method Not Allowed [Server: Apache-Coyote/1.1, Cache-Control: private, max-age=0, must-revalidate, Expires: Wed, 20 Jul 2016 06:48:54 GMT, Content-Length: 0, Date: Wed, 20 Jul 2016 06:48:54 GMT] org.apache.http.conn.BasicManagedEntity@3f4c24"

I have used the same method to add comments successfully,and I want to know if I have the wrong OSLC interface about timesheet .

0 votes


Be the first one to answer this question!

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,938
× 516

Question asked: Jul 20 '16, 9:34 p.m.

Question was seen: 2,020 times

Last updated: Jul 20 '16, 9:34 p.m.

Related questions
Confirmation Cancel Confirm