Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (4)
    As of 2020-12-05 18:08 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How often do you use taint mode?





      Results (65 votes). Check out past polls.

      Notices?