The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

JIRA::REST::Class::Issue - A helper class for JIRA::REST::Class that represents an

VERSION

version 0.12

DESCRIPTION

This object represents a JIRA issue as an object. It is overloaded so it returns the key of the issue when stringified, and the id of the issue when it is used in a numeric context. If two of these objects are compared as strings, the key of the issues will be used for the comparison, while numeric comparison will compare the ids of the issues.

METHODS

add_attachments

Accepts a list of filenames to be added to the issue as attachments.

add_attachment

Accepts a single filename to be added to the issue as an attachment.

add_data_attachment

Accepts a fake filename and a scalar representing the contents of a file and adds it to the issue as an attachment.

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.

has_label

Returns true if the issue has the specified label.

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 a hashref with named parameters summary and description. If the parameter issuetype is specified, then a subtask of the specified type is created. If no issuetype is specified, then the project is queried for valid subtask types, and, if there is only one, that type is used. If the project has more than one valid subtask type, an issuetype MUST be specified.

The remaining named parameters are passed to the create issue call as fields.

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() accessor on the JIRA::REST::Class::Project object to determine the name of the custom sprint field. Currently, this only really works if you're using Atlassian GreenHopper.

children

Returns a list of issue objects that are children of the issue. Currently 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.

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.

aggregatetimespent

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.

changelog

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

comments

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

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::Issue::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.

INTERNAL 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.

get

Wrapper around JIRA::REST::Class' get 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.

put

Wrapper around JIRA::REST::Class' put 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.

RELATED CLASSES

AUTHOR

Packy Anderson <packy@cpan.org>

COPYRIGHT AND LICENSE

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

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)