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

Getting 400 Bad Request while crating user story using OSLC API

Hi Everyone, I am trying to create a user story using OSLC API in Postman, Below are the details and Error which I am getting in postman please help any changes and suggestions to make it work, 

Thanks in Advance !


URL :  https://jazz.net/sandbox02-ccm/oslc/contexts/{my-project-area-id}/workitems
Authorization : Basic Auth (User Name & Password)
Headers : 
    Content-Type: application/json

    Accept: application/json
Request Body :

{
  "dcterms:title": "Your User Story Title",
  "dcterms:description": "Description of the user story",
  "rtc_cm:filedAgainst": {
  }
}


Getting Below Error  :

{
    "oslc:statusCode"400,
    "prefixes": {
        "oslc""http://open-services.net/ns/core#"
    },
    "oslc:message""Missing expected parameter: http://purl.org/dc/terms/type"
}

0 votes



3 answers

Permanent link
As the error message implies, you do not provide the required work item type. In addition the Factory URL is likely incorrect (it is missing the type). Finally, the header OSLC-Core-Version 2.0 is also missing.

0 votes

Comments

Also, OSLC supports the format Accept and Content-Type application/rdf+xml I am not sure JSON is supported.


Permanent link

Hi @Ralph Schoon, I forget to mention but I am providing OSLC version also in the headers:

OSLC-Core-Version:2.0


0 votes

Comments

As the error message implies, you do not provide the required work item type. The Factory URL is likely incorrect (it is missing the type). The factory is likely https://jazz.net/sandbox02-ccm/oslc/contexts/{my-project-area-id}/workitems/story , or you  have to provide the type in the request body. Again, see https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/


Permanent link

Thank you  Ralph Schoon for your response, I have followed the given link but still not working , below error is coming now :

URL :-  https://jazz.net/sandbox02-ccm/oslc/contexts/_BQSnUdPkEe-l4uedvx_w7A/workitems/defect
Headers : 

Content-Type:application/json
Accept:application/json
OSLC-Core-Version:2.0

Request Body:- 

{
           "dcterms:title""Your User Story Title",
           "dcterms:description""Description of the user story",
           "rtc_cm:filedAgainst": {
            "rdf:type""http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Category"
                
           
           }
         } Error :-
{
    "oslc:statusCode"500,
    "prefixes": {
        "oslc""http://open-services.net/ns/core#"
    },
    "oslc:message""Save Status\nCRRTC0290E: The work item cannot be saved because the work item's type is not configured correctly at the project level. \nThe category is not from the same project area as the work item.\n",
    "oslc:cause": {
        "oslc:statusCode"500,
        "oslc:message""Save Status"
    }
}

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,951

Question asked: Jan 20, 3:15 a.m.

Question was seen: 136 times

Last updated: Jan 20, 6:08 a.m.

Confirmation Cancel Confirm