Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convenience method for determining Required fields on artifact? #8

Open
mstieber opened this issue Feb 28, 2013 · 1 comment
Open

Comments

@mstieber
Copy link

It would be useful to have a convenience method for an artifact to disclose its Field-specific attribute definitions, especially for 'Required'.

@dawsmith8
Copy link

Hi Mike - I think this might be worth some other convenience methods, but for now wanted to note a way to get at the Required attribute on a field as an example:

fields = @rally.get_fields_for("defect")
puts "values -#{fields["State"].rally_object.keys}"  #gives you the list of attributes on the field like Required / Custom / Hidden
puts "state is required : #{fields["State"]["Required"]}"
puts "description is required : #{fields["Description"]["Required"]}"

This required knowing what is coming back from Rally's wsapi for the read on the Defect TypeDefinition. The get_fields_for method returns a hash where the key is the field's DisplayName in Rally and the specific attribute def as the field is the value.

A method I would think of adding is something like get_required_fields_for("type") or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants