Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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 } }

In reply to Help with looping by MysticElaine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found