NAME

JIRA::REST::Class::Issue - A helper class for JIRA::REST::Class that represents an individual JIRA issue as an object.

VERSION

version 0.01

READ-ONLY ACCESSORS

expand

A comma-separated list of fields in the issue that weren't expanded in the initial REST call.

fields

Returns a reference to the fields hash for the issue.

aggregateprogress

Returns the aggregate progress for the issue as a hash reference.

TODO: Turn this into an object.

aggregatetimeestimate

Returns the aggregate time estimate for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

aggregatetimeoriginalestimate

Returns the aggregate time original estimate for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

Baggregatetimespent>

Returns the aggregate time spent for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

assignee

Returns the issue's assignee as a JIRA::REST::Class::User object.

components

Returns a list of the issue's components as JIRA::REST::Class::Project::Component objects. If called in a scalar context, returns an array reference to the list, not the number of elements in the list.

component_count

Returns a count of the issue's components.

created

Returns the issue's creation date as a DateTime object.

creator

Returns the issue's assignee as a JIRA::REST::Class::User object.

description

Returns the description of the issue.

duedate

Returns the issue's due date as a DateTime object.

environment

Returns the issue's environment as a hash reference.

TODO: Turn this into an object.

fixVersions

Returns a list of the issue's fixVersions.

TODO: Turn this into a list of objects.

Returns a list of the issue's links.

TODO: Turn this into a list of objects.

issuetype

Returns the issue type as a JIRA::REST::Class::Issue::Type object.

labels

Returns the issue's labels as an array reference.

lastViewed

Returns the issue's last view date as a DateTime object.

parent

Returns the issue's parent as a JIRA::REST::Class::Issue object.

has_parent

Returns a boolean indicating whether the issue has a parent.

priority

Returns the issue's priority as a hash reference.

TODO: Turn this into an object.

progress

Returns the issue's progress as a hash reference.

TODO: Turn this into an object.

project

Returns the issue's project as a JIRA::REST::Class::Project object.

reporter

Returns the issue's reporter as a JIRA::REST::Class::User object.

resolution

Returns the issue's resolution.

TODO: Turn this into an object.

resolutiondate

Returns the issue's resolution date as a DateTime object.

status

Returns the issue's status as a JIRA::REST::Class::Status object.

summary

Returns the summary of the issue.

timeestimate

Returns the time estimate for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

timeoriginalestimate

Returns the time original estimate for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

timespent

Returns the time spent for the issue.

TODO: Turn this into an object that can return either seconds or a w/d/h/m/s string.

timetracking

Returns the time tracking of the issue as a JIRA::REST::Class::Issue::TimeTracking object.

transitions

Returns the valid transitions for the issue as a JIRA::REST::Class::Issue::Transitions object.

updated

Returns the issue's updated date as a DateTime object.

versions

versions

votes

votes

watches

watches

worklog

Returns the issue's change log as a JIRA::REST::Class::Worklog object.

workratio

workratio

id

Returns the issue ID.

key

Returns the issue key.

self

Returns the JIRA REST API's full URL for this issue.

url

Returns the JIRA REST API's URL for this issue in a form used by JIRA::REST::Class.

METHODS

make_object

A pass-through method that calls JIRA::REST::Class::Factory::make_object(), but adds a weakened link to this issue in the object as well.

add_comment

Adds whatever is passed in as a comment on the issue.

add_label

Adds whatever is passed in as a label for the issue.

remove_label

Removes whatever is passed in from the labels for the issue.

add_component

Adds whatever is passed in as a component for the issue.

remove_component

Removes whatever is passed in from the components for the issue.

set_assignee

Sets the assignee for the issue to be the user passed in. Can either be a string representing the name or a JIRA::REST::Class::User object.

set_reporter

Sets the reporter for the issue to be the user passed in. Can either be a string representing the name or a JIRA::REST::Class::User object.

Adds a link from this issue to another one. Accepts the link type (either a string representing the name or a JIRA::REST::Class::Issue::LinkType), the issue to be linked to, and (optionally) the direction of the link (inward/outward). If the direction cannot be determined from the name of the link type, the default direction is 'inward';

add_subtask

Adds a subtask to the current issue. Accepts the summary and description of the task as parameters, along with an optional hash reference of additional fields to define for the subtask. The project key and parent key are taken from the current issue, and the issue type ID is assigned from ...

TODO: currently, this is hardcoded to use issue type id 8, Technical Task. This should be genericized.

update

Puts an update to JIRA. Accepts a hash of fields => values to be put.

put_field

Puts a value to a field. Accepts the field name and the value as parameters.

reload

Reload the issue from the JIRA server.

sprints

Generates a list of JIRA::REST::Class::Sprint objects from the fields for an issue. Uses the field_name() method on the JIRA::REST::Class object to determine the name of the custom sprint field.

children

Returns a list of issue objects that are children of the issue. Requires the ScriptRunner plugin.

start_progress

Moves the status of the issue to 'In Progress', regardless of what the current status is.

start_qa

Moves the status of the issue to 'In QA', regardless of what the current status is.

resolve

Moves the status of the issue to 'Resolved', regardless of what the current status is.

open

Moves the status of the issue to 'Open', regardless of what the current status is.

close

Moves the status of the issue to 'Closed', regardless of what the current status is.

changelog

Returns the issue's change log as a JIRA::REST::Class::Changelog object.

INTERNAL METHODS

get

Wrapper around JIRA::REST's GET method that defaults to this issue's URL. Allows for extra parameters to be specified.

delete

Wrapper around JIRA::REST::Class' DELETE method that defaults to this issue's URL. Allows for extra parameters to be specified.

put

Wrapper around JIRA::REST::Class' PUT method that defaults to this issue's URL. Allows for extra parameters to be specified.

post

Wrapper around JIRA::REST::Class' POST method that defaults to this issue's URL. Allows for extra parameters to be specified.

AUTHOR

Packy Anderson <packy@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Packy Anderson.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)