Hello,
I built a very small Javascript application that updates a story field (Plan Estimate) using the SDK2 WSAPI.
- it works well when executed locally from my computer, I just need to be logged-in Rally (cookie) or to key-in my credentials at execution time
- it works well when embedded in Rally, thanks to a "Custom HTML" application, as I'm already logged in
What
I would like is to be able to run the embedded application (Custom HTML) even when not logged in Rally and without providing any credentials as clear text. For instance, if I provide the URL to another people that has no Rally account.
I generated a full-access ApiKey from
https://rally1.rallydev.com/login/accounts/index.html#/keysI don't understand how to use this key to reach my application, or even in my application code. Is it possible to achieve my goal thanks to the ApiKey?
Here is my code snippet:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/apps/2.1/sdk.js"></script>
</head>
<body>
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('Rally.test', {
extend: 'Rally.app.App',
launch: function() {
var displayPanel = Ext.create("Ext.Panel", {
itemId: "displayPanel",
height: 800,
autoScroll: true,
html: ['<div id="displayContainer"></div>'],
listeners: {
afterrender: function() {
Rally.data.ModelFactory.getModel({
type: 'UserStory',
context: { workspace: '/workspace/12345',
project: '/project/12345',
},
success: function(model)
{
var sInRally = model.load(('US12345'),{
fetch: ['Notes', 'PlanEstimate', 'c_MAActuals'],
callback: function(record, operation){
record.set('PlanEstimate', 3);
record.save({
callback: function(record, operation) {
if(!operation.wasSuccessful()) {
console.log(' - Update failure!');
}
}
});
}
});
},
failure: function(error){
console.log(' - Update failure! (model)');
}
});
}
}
});
this.add(displayPanel);
}
});
Rally.launchApp('Rally.test', {
name: 'test'
});
});
</script>
</body>
</html>
Thanks for your help,
Greg.