create work item with REST service
Hi,
I am trying to create work item with REST service with json structure.
In old version of REST addons of Google Chrome and Mozzila Firefox I was successfull to do it, but now I am getting 302 status always, which says that I need authentification.
I 've been already authenticated during the REST service call, but still the same thing.
Now, I am using only Mozzila firefox rest addon.
Here is my url for creating work item in JKE banking (ccm):
https://clm_server:9443/jazz/oslc/contexts/_SBqxwYO_Eea1JuvQPYWTpg/workitems/task
Here is my body content:
{
"dc:title":"Test work item",
"dc:description":"Test wi description",
"dc:type":
{
"rdf:resource":"https:\/\/clm_server:9443\/jazz\/oslc\/types\/_SBqxwYO_Eea1JuvQPYWTpg\/task"
},
"rtc_cm:filedAgainst":
{
"rdf:resource":"https:\/\/clm_server:9443\/jazz\/resource\/itemOid\/com.ibm.team.workitem.Category\/_uJOSiIO_Eea1JuvQPYWTpg"
},
"rtc_cm:state":{"rdf:resource":"https:\/\/clm_server:9443\/jazz\/oslc\/workflows\/_SBqxwYO_Eea1JuvQPYWTpg\/states\/com.ibm.team.workitem.taskWorkflow\/1"},
"rtc_cm:ownedBy":
{
"rdf:resource":"https:\/\/clm_server:9443\/jts\/users\/bob"
},
"rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent":[
{
"rdf:resource":"https:\/\/clm_server:9443\/jazz\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/215813"}]
}
After I run Send, I am getting the following response:
It seems my user don't have appropriate rights, but I am logged in while I 've been executing this REST service.
Am I doing something wrong?
Kind regards,
Milan
3 answers
You said the return code was 302 but your screen shot shows 403. Which one is correct?
If your screen shot is to be trusted, the error message says that your account lacks the JazzUsers (or JazzAdmins) repository role. As you appear to be using Firefox with the RESTClient addon, and you log on CCM already, the easiest way to verify is to go into the user profile and see what Repository Permissions have been assigned.
If your screen shot is to be trusted, the error message says that your account lacks the JazzUsers (or JazzAdmins) repository role. As you appear to be using Firefox with the RESTClient addon, and you log on CCM already, the easiest way to verify is to go into the user profile and see what Repository Permissions have been assigned.
Hi,
sorry for my late answer.
I am getting 403 Forbidden, and I checked for several times, my user is a part of Security groups that can access to JTS.
Is there could be a reason in authentication type? We are using WAS 8.5.5. and SSO mechanism.
Regards,
Milan
just to know, we are using form-based authentication.
Is there any example for calling rest service with form-based authentication?
Regards,
milan
Comments
I've answered in your other post. Check this out.
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Appendix_A