NAME

JIRA::REST::Lite - Lightweight wrapper around Jira's REST API

SYNOPSIS

use JIRA::REST::Lite;

my $jira = JIRA::REST::Lite->new({
    url      => 'https://jira.example.net',
    username => 'myuser',
    password => 'mypass',
});

my $jira_with_session = JIRA::REST::Lite->new({
    url      => 'https://jira.example.net',
    username => 'myuser',
    password => 'mypass',
    session  => 1,
});

my $jira_with_pat = JIRA::REST::Lite->new({
    url => 'https://jira.example.net',
    pat => 'NDc4NDkyNDg3ODE3OstHYSeYC1GnuqRacSqvUbookcZk',
});

my $jira_anonymous = JIRA::REST::Lite->new({
    url => 'https://jira.example.net',
    anonymous => 1,
});

# 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 is a lightweight module that provides a simple interface to Jira's REST API. It's designed to be minimal in its dependencies while still offering essential functionalities for interacting with Jira.

METHODS

  • new

    Constructor. Creates a new instance of the JIRA::REST::Lite client.

  • new_session

    Alternative constructor that creates a session-based client.

  • GET

    Performs a GET request to the specified API endpoint.

  • POST

    Performs a POST request to the specified API endpoint.

  • PUT

    Performs a PUT request to the specified API endpoint.

  • DELETE

    Performs a DELETE request to the specified API endpoint.

  • set_search_iterator

    Sets up an iterator for searching Jira issues.

  • next_issue

    Fetches the next issue in the search result.

  • attach_files

    Attaches files to a Jira issue.

REPOSITORY

https://github.com/kawamurashingo/JIRA-REST-Lite

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.