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

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

0 votes



3 answers

Permanent link
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.

0 votes


Permanent link

 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

0 votes

Comments

In WAS, security role mapping is done separately in JTS and CCM/(jazz in your case), so you need to do it separately. Having a correct role in JTS does not automatically give you the correct one in CCM.


Permanent link

 just to know, we are using form-based authentication.

Is there any example for calling rest service with form-based authentication?

Regards,
milan

0 votes

Comments

I've answered in your other post. Check this out.
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Appendix_A

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
× 12,019
× 7,495
× 137
× 57
× 19

Question asked: Oct 20 '16, 10:06 a.m.

Question was seen: 4,826 times

Last updated: Feb 20 '17, 7:06 p.m.

Confirmation Cancel Confirm