i do the same exact with ARS Perl. Here's the function I use to update tickets. I call this function with two arguments: 1: incident number in the HPD:Help Desk form and list each fieldname, value pair separated by ##.

Example: updateTicket("INC000000034", "ORIG_TRS_SEVERITY=4##PRIME-LOC=ABC##CURR-LOC=ABC')

sub updateTicket {
 my $incident = shift;
  my $update_data = shift;

 $server = "x.x.x.x";
 $username = "xxxxx";
 $password = "xxxx";
 $currTime = time();
($ctrl = ars_Login($server, $username, $password)) || die "couldn't allocate control structure";

  $schema = "HPD:IncidentInterface";
  %fval = ars_GetFieldTable($ctrl, $schema);

 my @updRemString;
  @fieldvalues = split(/##/, $update_data);
  foreach (@fieldvalues) {
     @valuepair = split(/=/, $_);
     if($valuepair[0] eq "ORIG_TRS_SEVERITY") {
        push(@updRemString, $fval{'ORIG_TRS_SEVERITY'});
     }
     if($valuepair[0] eq "Vendor_Link_Status") {
        push(@updRemString, $fval{'Vendor Link Status'});
     }
     if($valuepair[0] eq "PRIME-LOC") {
        push(@updRemString, $fval{'PRIME-LOC'});
     }
     if($valuepair[0] eq "CURR-LOC") {
        push(@updRemString, $fval{'CURR-LOC'});
     }
     push(@updRemString, $valuepair[1]);
  }

($qual = ars_LoadQualifier($ctrl, $schema, "'Incident Number*' = \"$incident\"")) || die "ars_LoadQualifier: $ars_errstr";
  @entries = ars_GetListEntry($ctrl, $schema, $qual, 0, 0);
  $record = $entries[0];
ars_SetEntry($ctrl, $schema, $record, 0, @updRemString) || die "ars_SetEntry(User): $ars_errstr";

}

HTH
Ravi

Eli Schilling wrote:
**
Happy Friday Listers!
So I'm looking for a quick and easy way to update a ticket (single field value) without requiring the user to log in. I'm on ARS 7.1 with Mid-tier 7 on Apache Tomcat. I started by trying to do it via public webservice but couldn't find a way to consume a web service using javascript (unless there's another language supported by Tomcat that would work). So then I thought...what about using jdbc to update the value directly into the database...well; that was a miserable failure as well. I know it can be done I just can't seem to find any examples of the code, nor is my syntax even close to being correct. So, has anyone taken one of these two routes and can you help me out? Or is there another, BETTER way? Thanks all! Eli __Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" html___

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to