Class: Youtrack::Tag
Instance Attribute Summary
Attributes inherited from Base
#base_url, #response, #service
Instance Method Summary collapse
-
#create(attributes = {}) ⇒ Object
add new user’s tag.
-
#get_all_tags ⇒ Object
get all user’s tags.
-
#get_tag_by_name(tag_name) ⇒ Object
get a user’s tag by name.
-
#update(attributes = {}) ⇒ Object
update an existing tag.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Youtrack::Base
Instance Method Details
#create(attributes = {}) ⇒ Object
add new user’s tag
attributes: tagName (required) String The name of the new tag visibleForGroup (required) String Name of a user group in which tag should be visible updatableByGroup (required) String Name of user group whose members can edit the new tag untagOnResolve (optional) Boolean autoremove when issue’s state changes
API Success: Returns 201 Created with Location Header set Returns the response object
27 28 29 30 31 |
# File 'lib/youtrack/resources/tag.rb', line 27 def create(attributes={}) tag_name = attributes.delete(:tagName) put("user/tag/#{tag_name}", attributes) response end |
#get_all_tags ⇒ Object
get all user’s tags
5 6 7 8 |
# File 'lib/youtrack/resources/tag.rb', line 5 def get('user/tag') response.parsed_response end |
#get_tag_by_name(tag_name) ⇒ Object
get a user’s tag by name
11 12 13 14 |
# File 'lib/youtrack/resources/tag.rb', line 11 def get_tag_by_name( tag_name ) get("user/tag/#{tag_name}") response.parsed_response end |
#update(attributes = {}) ⇒ Object
update an existing tag
attributes: tagName (required) String The name of tag to edit. newName (required) String the new name for the tag. visibleForGroup (required) String Name of a user group in which tag should be visible updatableByGroup (required) String Name of user group whose members can edit the new tag untagOnResolve (optional) Boolean autoremove when issue’s state changes
API Success: Returns 301 Moved Permanently with Location Header set Returns the response object
45 46 47 48 49 |
# File 'lib/youtrack/resources/tag.rb', line 45 def update(attributes={}) tag_name = attributes.delete(:tagName) post("user/tag/#{tag_name}", attributes) response end |