Perl Tutorial : Perl data types
Perl Tutorial : Perl Operators
Perl Tutorial : Perl loops
Perl Tutorial : Perl Conditionals
Perl Tutorial : Perl Subroutines
Perl Tutorial : Perl regex
Perl Tutorial : Perl Files
Perl Tutorial : Perl & Databases
Perl Tutorial : Perl OOPs
Perl Tutorial : Perl signals
Perl Tutorial : Perl threads
Perl Tutorial : Perl Debugging

Introcution to Perl CGI

Introduction to modperl
Home >> perlcgitutorial >>

Perl and JIRA

JIRA combines issue tracking, agile project management, customisable workflow, and a pluggable integration framework to increase the velocity of your software development team.

You can use following example to create issues via webpage...

#!/usr/bin/perl 
use strict; 
use CGI;
use XMLRPC::Lite; 
use Data::Dumper; 
my $cgi=new CGI;
my $project=$cgi->param('project');
my $action=$cgi->param('action');
my $assigne=$cgi->param('assigne');
my $summary=$cgi->param('summary');
my $description=$cgi->param('description');
print "Content-type: text/html\r\n\r\n";
&main();

if($action eq "create"){&create();}

#############################################

sub main
{
print "<form>
<table>
<tr><td>Summary</td><td><input type=text name=summary></td></tr>

<tr><td>Project</td><td>&lt;input type=text name=project&gt;</td></tr>
<tr><td>Assigne</td><td>&lt;input type=text name=assigne&gt;</td></tr>
<tr><td>Description</td><td>&lt;text area name=description&gt;</textarea></td></tr>
</table><input type=submit name=submit value=submit><input type=hidden name=action value=create></form>";


}


######################

sub create
{
my $jira = XMLRPC::Lite->proxy('http://localhost:8080/jira/rpc/xmlrpc'); 
my $auth = $jira->call("jira1.login", "admin", "admin")->result(); 
my $call = $jira->call("jira1.createIssue", $auth, { 
'project' => $project, 
'type' => 2, 
'summary' => $summary, 
'assignee' => $assigne, 
'description' => $description}); 
my $fault = $call->fault(); 
if (defined $fault) { 
print $call->faultstring(); 
die $call->faultstring(); 
} else { 
    
print "issue created:\n"; 
print Dumper($call->result()); 
} 
$jira->call("jira1.logout", $auth);

}


Perl functions

scalars and strings

lc
ord

regex (regular expressions)

arrays

shift
split

More..

eval
Share |

Perl CGI Tutorial

Perl examples

  • How to use Data::Dumper?
  • How to parse config file?
  • Include external module in perl..
  • Download perl

    download stable version of perl
    Perl 5.10.1
    Perl interview Questions
    sed tutorial
    awk tutorial

    Join us on Google Groups

    Subscribe to perl
    Email:
    Visit this group
    Perl Jobs


    privacy | sitemap | disclaim | contact us
    © 2009 perlhome.com