Hi, I am trying to figure out why my if ($do_ECP_approved) isn't going for each issue. It is within my for loop, and the if ($do_labcloud_request) works as intended sending an email for each issue. Thanks!
for my $i (@issues){
+
+
my $intid = undef;
my $id = $i->issue_id;
my @assets = NIE::Issue->search($id);
my ($assets, $oops) = NIE::Issue->search($id);
my $ip = $assets->ip_asset_ip_address;
$age = $assets->ticket_age;
my $name = $assets->owner_login;
$count = 2;
while ($count >= 1){
$delegated_status = Update_ticket('s');
$comments = Update_ticket ('c');
if ($count >1) {
$activity_type = Update_ticket('t');
} else {$activity_type = Update_ticket('d');}
my $verbage = undef;
$verbage .= sprintf "----------\nIssue: %s\n", $i->iss
+ue_id ;
$verbage .= sprintf "IssueStatus: %s->%s\n", $i->statu
+s,
$issue_status if ($issue_status);
$verbage .= sprintf "ActivityType: %s\nActivityAbstrac
+t:
\"%s\"\nActivityComments:\n\"%s\"\n", $activity_type,
$abstract, $comments if ($activity_type);
$verbage .= sprintf "DelegatedStatus: %s->%s\n",
$i->delegated_status, $delegated_status if ($delegated
+_status);
if ($prompt_to_update && !$yes_just_once) {
my $reply = $term->get_reply(
prompt => "y/n/YES/NO?" .
" (YES/NO => y/n to all tickets)",
allow => ['y','n','YES','NO'],
print_me => $verbage);
next if ($reply eq 'n');
last if ($reply eq 'NO');
$prompt_to_update = undef if ($reply eq 'YES');
}
$yes_just_once = 0 if ($yes_just_once);
printf "Updating %s\n", $i->issue_id;
if ($live) {
$intid = addFollowup($i->issue_id,
$abstract,
$comments,
undef,
undef,
undef,
undef,
$activity_type);
}
if ($delegated_status) {
if ($live && $i->delegated_status ne $delegated_st
+atus) {
$intid = UpdateNoccSRTicket(
'SRId' => $i->issue_id,
'DelegatedStatus' => $delegated_status
);
}
}
if ($issue_status){
if ($live && $i->status ne $issue_status) {
$intid = UpdateNoccSRTicket(
'SRId' => $i->issue_id,
'Status' => $issue_status
);
}
}
}
continue {
--$count;
$count = 0 if ($do_ECP_approved);
}
if ($do_labcloud_request){
.....
mail_func($name,$sub_ref,$body_ref);
}
if ($do_ECP_approved){
print "I need to change ownership back to $name for $ip\n"
+;
#lab-owner --set-owner $name $ip -u
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.