Fixed perl script to create tiquet in integria. Tiquet: #3690

(cherry picked from commit a15739bed1)
This commit is contained in:
m-lopez-f 2016-06-06 15:06:24 +02:00
parent 94a9009d72
commit 5a0b87819d
1 changed files with 24 additions and 9 deletions

View File

@ -44,11 +44,11 @@ Optional parameters:
[-email <email_copy>] : 1 or 0\n\n"; [-email <email_copy>] : 1 or 0\n\n";
print "Credential/API syntax: \n\n"; print "Credential/API syntax: \n\n";
print "<credentials>: API credentials separated by comma: <api_pass>,<user>\n\n"; print "<credentials>: API credentials separated by comma: <api_pass>,<user>,<user_pass>\n\n";
print "Example of ticket generation:\n\n"; print "Example of ticket generation:\n\n";
print "\t$0 -p http://localhost/integria/include/api.php -u 1234,admin \ print "\t$0 -p http://localhost/integria/include/api.php -u 1234,admin,1234 \
\t-create_ticket -name \"SampleTicket\" -group 1 -priority 2 -desc \"This is a sample\" \ \t-create_ticket -name \"SampleTicket\" -group 1 -priority 2 -desc \"This is a sample\" \
\t-type 4 -inventory 6 -email 1"; \t-type 4 -inventory 6 -email 1";
print "\n\n\n"; print "\n\n\n";
@ -126,6 +126,7 @@ sub tool_api_main () {
else { else {
$api_pass = $db_info[0]; $api_pass = $db_info[0];
$db_user = $db_info[1]; $db_user = $db_info[1];
$db_user_pass = $db_info[2];
} }
} }
else { else {
@ -178,15 +179,29 @@ sub tool_api_main () {
exit; exit;
} }
#~ $data_ticket = $ticket_name .
#~ "|;|" . $group_id .
#~ "|;|" . $ticket_priority .
#~ "|;|" . $ticket_description .
#~ "|;|" . $ticket_inventory .
#~ "|;|" . $ticket_type .
#~ "|;|" . $email_copy;
$data_ticket = $ticket_name . $data_ticket = $ticket_name .
"|;|" . $group_id . "|;|" . $group_id .
"|;|" . $ticket_priority . "|;|" . $ticket_priority .
"|;|" . $ticket_description . "|;|" . $ticket_description .
"|;|" . $ticket_inventory . "|;|" . $ticket_inventory .
"|;|" . $ticket_type . "|;|" . $ticket_type .
"|;|" . $email_copy; "|;|" . $email_copy .
"|;|" . $email_copy .
"|;|" .
"|;|" . '1' .
"|;|" .
"|;|";
$call_api = $api_path . '?' . $call_api = $api_path . '?' .
'user=' . $db_user . '&' . 'user=' . $integria_user . '&' .
'user_pass=' . $user_pass . '&' .
'pass=' . $api_pass . '&' . 'pass=' . $api_pass . '&' .
'op=create_incident&' . 'op=create_incident&' .
'params=' . $data_ticket .'&' . 'params=' . $data_ticket .'&' .