Comments (6)
Just a heads up that there's a Rally tag forum on Stackoverflow - https://stackoverflow.com/questions/tagged/rally where Rally developers frequently answer toolkit usage questions similar to this one. It helps maintain focus on GitHub issues for identified bugs in the toolkit.
This Gist:
https://gist.github.com/markwilliams970/6a1380f4949c12a678a1
contains an example of saving attachment content that should help you, but the core of it is to Base64 decode the content string, and write the resulting bytes to a file:
require 'base64'
def save_attachment(this_attachment)
file_name = this_attachment.Name
this_attachment_content = this_attachment.Content
if this_attachment_content == nil
# Yes it is possible to have an attachment with no content
extension = ".empty"
file_data = File.new(file_name + extension, "wb")
else
this_attachment_content.read
this_content = this_attachment_content.Content
file_data = File.new(file_name, "wb")
file_data.syswrite(Base64.decode64(this_content))
end
puts " Saved filename=#{file_name} Size=#{this_attachment.Size}\n"
file_data.close
end
from rallyresttoolkitforruby.
It seems that this can be decoded as a base64 but still, this is at least a bug in the documentation if not even in the API, that it does not provide the content in binary format.
from rallyresttoolkitforruby.
The API is working as expected. I'll check with the toolkit author to see about getting a similar example included in the examples directory in the Github repo.
from rallyresttoolkitforruby.
The AP is working, what I was trying to say is that is not documented. The simple fact that both of us had to google around (and use the debugger in my case) just to discover how to get the content of the attachment is clearly a "design bug".
Just to confirm this bug, I observed somebody else raising a ticket regarding making attachment API easier to use. See issue #26
from rallyresttoolkitforruby.
Thanks for the feedback. In general the API toolkit docs are meant to supplement, but not replace, the full webservices API docs, https://rally1.rallydev.com/slm/doc/webservice. The documentation for the AttachmentContent object: https://rally1.rallydev.com/slm/doc/webservice/objectModel.sp#AttachmentContent indicates how to traverse the object model to find the needed data, as well as its type (base64Binary).
from rallyresttoolkitforruby.
Also for what it's worth - the ruby toolkit author would seem to agree with you that additional methods to help with getting attachments would be desirable enhancements. Issue #26 as you reference above was created by the toolkit author himself :)
from rallyresttoolkitforruby.
Related Issues (20)
- Make rallyobject.[]= and rally_object.update cache fields that changed and pass them
- spike support for Lookback API
- Add easier convenience methods for working with attachments
- Convenience method for working with Portfolio Item states
- Add helper methods for dealing with custom fields - in wsapi 2 - custom fields are c_fieldname
- License missing from gemspec HOT 2
- Create User story query HOT 1
- Update TestResults for desired Test Case? HOT 2
- 507 Insufficient Storage error
- New warning message appearing HOT 1
- Query searches across projects when it shouldn't
- uninitialized constant RallyAPI::RallyJsonConnection::OpenSSL
- $wsapi_version variable problem
- Querying for an object's children HOT 4
- Object#timeout is deprecated, use Timeout.timeout instead. HOT 1
- When running the example from the README, I get not in gzip format
- URI encoding needed?
- Creating an object with Project.ObjectId instead of Project.Name?
- Unable to extract portfolioitem/minimumbusinessincrement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rallyresttoolkitforruby.