Class: Issue
- Inherits:
-
Object
- Object
- Issue
- Defined in:
- lib/jirarest2/issue.rb
Overview
represent an issue
Instance Attribute Summary collapse
-
#assignee ⇒ Object
readonly
Person the issue is assigned to.
Instance Method Summary collapse
-
#createmeta(issuetype) ⇒ Object
Interpret the result of createmeta for one issuetype.
-
#initialize(issueid) ⇒ Issue
constructor
A new instance of Issue.
-
#receive(connection) ⇒ Object
Receive an issue and all it’s fields from jira.
-
#remove_assignee(connection) ⇒ Object
Deletes an assignee.
-
#set_assignee(connection, name) ⇒ Boolean
Set an assignee to an issue.
Constructor Details
#initialize(issueid) ⇒ Issue
Returns a new instance of Issue.
25 26 27 |
# File 'lib/jirarest2/issue.rb', line 25 def initialize(issueid) @issueid = issueid end |
Instance Attribute Details
#assignee ⇒ Object (readonly)
Person the issue is assigned to
22 23 24 |
# File 'lib/jirarest2/issue.rb', line 22 def assignee @assignee end |
Instance Method Details
#createmeta(issuetype) ⇒ Object
Interpret the result of createmeta for one issuetype
68 69 70 |
# File 'lib/jirarest2/issue.rb', line 68 def (issuetype) @name = issuetype end |
#receive(connection) ⇒ Object
TODO:
This method does not work yet
Receive an issue and all it’s fields from jira
32 33 34 35 36 37 |
# File 'lib/jirarest2/issue.rb', line 32 def receive(connection) uritail = "issue/#{@issueid}" result = connection.execute("Get",uritail,{"expand" => "metadata"}) # get the issue AND the metadata because we already know how to parse that. return result # TODO Many and more fields end |
#remove_assignee(connection) ⇒ Object
Deletes an assignee. It actually only calls set_assignee with name = nil .
62 63 64 |
# File 'lib/jirarest2/issue.rb', line 62 def remove_assignee(connection) set_assignee(connection, nil) end |
#set_assignee(connection, name) ⇒ Boolean
Set an assignee to an issue
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/jirarest2/issue.rb', line 44 def set_assignee(connection, name) uritail = "issue/#{@issueid}/assignee" if ! name.nil? then setname = {"name" => name} else setname = nil end retcode = connection.execute("Put",uritail,setname).code if retcode == "204" then @assignee = name return true else return false end end |