Class: Youtrack::Project

Inherits:
Base
  • Object
show all
Defined in:
lib/youtrack/resources/project.rb

Instance Attribute Summary

Attributes inherited from Base

#base_url, #response, #service

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Youtrack::Base

Instance Method Details

#allObject

ADMIN Methods



29
30
31
32
# File 'lib/youtrack/resources/project.rb', line 29

def all
  get('admin/project')
  response.parsed_response
end

#create(attributes = {}) ⇒ Object

required attributes

projectId string required Unique identifier of a project to be created. This short name will be used as prefix in issue IDs for this project. projectName string required Full name of a new project. Must be unique. startingNumber integer required Number to assign to the next manually created issue. projectLeadLogin string required Login name of a user to be assigned as a project leader. description string Optional description of the new project



46
47
48
49
# File 'lib/youtrack/resources/project.rb', line 46

def create(attributes={})
  put("admin/project/#{attributes[:projectId]}", query: attributes)
  response
end

#destroy(project_id) ⇒ Object



51
52
53
54
# File 'lib/youtrack/resources/project.rb', line 51

def destroy(project_id)
  delete("admin/project/#{project_id}")
  response
end

#find(project_id) ⇒ Object



34
35
36
37
# File 'lib/youtrack/resources/project.rb', line 34

def find(project_id)
  get("admin/project/#{project_id}")
  response.parsed_response
end

#get_accessible_projectsObject

USER Methods



7
8
9
10
# File 'lib/youtrack/resources/project.rb', line 7

def get_accessible_projects
  get('project/all')
  response.parsed_response
end

#get_issues_for(project_id, max, filter, options = {}) ⇒ Object

Default value for issues to load via API - 500. Check your Settings page in Admin menu - “Max Issues to Export” parameter should be set to issues count that you actually need.



20
21
22
23
24
# File 'lib/youtrack/resources/project.rb', line 20

def get_issues_for(project_id, max,filter,options={})
  max = 10 unless max
  get("issue/byproject/#{project_id}?max=#{max}&filter=#{filter}")
  response.parsed_response
end