Service...L::Task(3)
π Task module π
okay so bestie, welcome to Service...L::Task from the Service-now Perl API π
this is the page for the Task module, and honestly? it's giving backbone. everything else kinda hangs off it.
π Desciption π
(yes that's the heading, typos are canon, we don't fix the vibes β¨)
So Task is an object representation of a Task in the Service-now platform. It comes with subroutines for querying, updating, and creating tasks.
And here's the iconic part β Task is the parent class of Incident, Problem, Change, SC_Task and Ticket. π All of those child classes inherit subroutines from this class, so when you learn Task you basically learned the whole family. main character energy fr fr.
πΈ System Requirements πΈ
The Service-now Perl API needs Perl 5.8 plus these modules installed:
SOAP::Lite(prerequisiteshttp://soaplite.com/prereqs.html) 0.71 or laterCrypt::SSLeayIO::Socket::SSL
β¨ Constructor β¨
new
new(Configuration);
Example:
$task = ServiceNow::ITIL::Task->new($CONFIG);
It takes a configuration object and manufactures a Task object connected to the Service-now instance. that's it, that's the whole vibe check π¦
π«Ά Subroutines π«Ά
create
create(optional paramaters)
Example:
$task->create();
Creates and inserts a Task/Incident/Ticket/SC_Task record into the respective table. π§ Returns the number of created record on success, and undef on failure. so like, always check your return value, no cap.
close
close(number of record, optional parameters)
Example:
$task->close('INC1000312');
Sets the state of Task/Incident/Ticket/SC_Task to closed and updates the respective table. Returns the number of created record on success, undef on failure. π
reopen
reopen(number of record, optional parameters)
Example:
$task->reopen('TKT1003010');
Sets the state of Task/Incident/Ticket/SC_Task to open and updates the respective table. the glow-up reversal we all needed β¨
reassign
reassign(number, group, user);
Example:
$incident->reassign($number, 'Database', 'user')
Re-assign an incident to the group and user specified. lowkey the most useful thing ever when someone's ticket lands in the wrong queue π
queryJournal
queryJournal(configuration file, optional field name)
Example:
$task->queryJournal($config, 'work_notes');
Returns an array of hash references to each journal associated with the current Task/Incident/Ticket/SC_Task. The optional field name refines the search to a specified field. π₯
attach
attach(file path)
Example:
$task->attach("/Users/davidloo/Desktop/test_files/number_test.xls");
Attach a file to a record of Task. π
that's the whole page bestie, go forth and slay your tasks π
perl v5.42.0 Β· 2025-07-25 Β· Service...L::Task(3) β mwah, that's the source, the version and the date, sign-off complete ππ«Ά
π¦ where this page comes from
- fedora 43: perl-ServiceNow-API 1.01-38.fc43 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms