How to fetch and populate streams and baselines in custom attribute of work item based on GC Project area?
![]() Hello,
We are trying to fetch and populate the streams and baselines in custom attribute of a work item in CCM based on the select GC project area in another custom attribute. While exploring we came to know that this is possible via dojo scripting but we need an API to fetch the streams and baselines based on the GC project area information. Is it possible to fetch via dojo scripting? Please suggest if there is any better way to fetch the streams or baselines based on GC Project area information,
Thanks and Regards,
Rohit
|
One answer
![]()
David Honey (1.7k●1●7)
| answered Jul 13, 12:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER You will need to use Ajax to make REST calls to GCM. See https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding for public GCM REST APIs. That page has a link to https://jazz.net/gc/doc/scenarios which describes the operations you can perform and includes examples. Comments Hello David, I tried the above links. I am able to understand the GC API's, but when I am trying to make an API call (using dojo) I am getting errors. I tried dojo.xhrGet and XMLHttpRequest() as well but both of them are not working.
For dojo.xhrGet, my pseudocode:
var xhrArgs = {
url: url,
handleAs: "json",
preventCache: true,
load: function(response) {
/ Do something with response /
},
error: function(response) {
/ Do something with response /
}]};
var deferred = dojo.xhrGet(xhrArgs);
The error which I get is:
TypeError: Cannot find function xhrGet in object [object Object].
Could you please let me know how can I get around this error. I tried to search but I am not able to find any solution.
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I suggest you start by using web browser plugins such as Postman or RESTed. Get that working to achieve what you want first. As far as the Dojo error is concerned, that's a Dojo question not a Jazz question. There are plenty of online resources that provide tutorials for Ajax from Javascript or Dojo.
|
Comments
You will need to use Ajax to make REST calls to GCM. See https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding for public GCM REST APIs.
Hello David,
If you followed the link I gave, you will see there is a link to the GCM REST API pages, one of which is https://jazz.net/gc/doc/scenarios which describes the operations you can perform and includes examples.