Thanks David.
I am getting a different error now.
16:23:55:200 USER_DEBUG [54]|DEBUG|{"CreateResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": ["Not authorized to perform action: Invalid key"], "Warnings": []}}
I passed the security api token for the PUT .
https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/create?key=MGQ1CfvRYK09vAOyN1lDgLAVkkR02tlGK7tRTM58.The code I tried ,
request.setEndPoint(apitoken);
System.debug('End Point'+ apitoken);
// Set the HTTP verb to G
request.setBody('{"HierarchicalRequirement": { "Name": "Hello world", "Description": "Hello world","Owner": "Regi Varghese" } }');
request.setMethod('PUT');
HttpResponse response1= httpProtocol.send(request);
System.debug(response1.getBody());
Original Message:
Sent: 10-03-2019 01:07 PM
From: David LeDeaux
Subject: How to create a new user story in Rally using Rest API
Hi Regi,
I'm not certain I understand what you mean by a "request service contract". Are you referring to a payload? If so, here's a sample payload:
{ "HierarchicalRequirement": { "Name": "Hello world", "Description": "Hello world" }}
Original Message:
Sent: 10-03-2019 12:37 PM
From: Regi Varghese
Subject: How to create a new user story in Rally using Rest API
Hi David
I do not have the request service contract for creating an user story.
Could you please share one if you have one handy?
Regi
Original Message:
Sent: 10-02-2019 09:55 AM
From: David LeDeaux
Subject: How to create a new user story in Rally using Rest API
Hi Regi,
In your code you're setting your method to GET where it should be a PUT or POST
But also, you will need to pass at least a Name attribute in addition to any required fields you may have defined on your user stories.
Original Message:
Sent: 10-02-2019 12:31 AM
From: Regi Varghese
Subject: How to create a new user story in Rally using Rest API
I am trying to create a new User Story in Rally from Salesforce Apex.
What I tried so far.
Got the security API using JSON REST URI -https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize .As User story is a HierarchicalRequirement then create (PUT) using JSON REST URI https://demo-rally.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/create?key= ,where key is the security token.
Code I tried:
endpoint = 'https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/create?key=Jstring';
request.setEndPoint(endpoint);
// Set the HTTP verb to GET.
request.setMethod('GET');
HttpResponse response1 = httpProtocol.send(request);
Receiving the following error..
21:01:26:416 USER_DEBUG [48]|DEBUG|{"QueryResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": ["Not able to parse artifact type: hierarchicalrequirement/create"], "Warnings": [], "TotalResultCount": 0, "StartIndex": 0, "PageSize": 0, "Results": []}}
Any help is greatly apreciated..