NAME
JIRA::REST::Lite - A lightweight Perl module for interacting with JIRA REST API
SYNOPSIS
use JIRA::REST::Lite;
my $jira = JIRA::REST::Lite->new({
url => 'https://jira.example.net',
username => 'myuser',
password => 'mypass',
});
# File a bug
my $issue = $jira->POST('/issue', undef, {
fields => {
project => { key => 'PRJ' },
issuetype => { name => 'Bug' },
summary => 'Cannot login',
description => 'Bla bla bla',
},
});
# Get issue
$issue = $jira->GET("/issue/TST-101");
# Iterate on issues
$jira->set_search_iterator({
jql => 'project = "TST" and status = "open"',
maxResults => 16,
fields => [ qw/summary status assignee/ ],
});
while (my $issue = $jira->next_issue) {
print "Found issue $issue->{key}\n";
}
# Attach files
$jira->attach_files('TST-123', '/path/to/doc.txt', 'image.png');
DESCRIPTION
JIRA::REST::Lite provides a simple interface for interacting with the JIRA REST API, with minimal dependencies.
METHODS
new
my $jira = JIRA::REST::Lite->new(\%args);
Creates a new JIRA::REST::Lite object. The arguments can include url
, username
, password
, session
, pat
, and anonymous
.
POST
my $issue = $jira->POST($path, \%headers, \%payload);
Performs a POST request to the JIRA API.
GET
my $issue = $jira->GET($path);
Performs a GET request to the JIRA API.
set_search_iterator
$jira->set_search_iterator(\%params);
Sets up an iterator for searching JIRA issues.
next_issue
while (my $issue = $jira->next_issue) {
print "Found issue $issue->{key}\n";
}
Fetches the next issue from the search iterator.
attach_files
$jira->attach_files($issue_key, @files);
Attaches files to a JIRA issue.
AUTHOR
[Kawamura Shingo] <pannakoota@gmail.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.