HP servicedesk: use sd_event to create and update items
HP ServiceDesk offers the sd_event command-line tool to interact with its database. Using classes and mappings inside HPSD, you can configure exactly how sd_event can create and/or update items the database. For instance, to create new person registrations from the command-line, first create and configure the class and mappings inside HPSD. Then, use the sd_event tool using an .ini file:
Contents “person-sd-create.ini”
[SD_EVENT]
LOGFILE=E:sd_eventbinperson_sd_create.log
ERROR_LOGFILE=E:sd_eventbinperson_sd_create_error.log
ACCOUNT=[insert username]/[insert password]
SERVER=[insert server here]
PORT=30980
MAPPING=[insert mapping here]
CLASSNAME=[insert classname here]
MODUS=insert
LANGUAGE=NL
Run the sd_event command-line tool
sd_event.exe -f person-sd-create.ini -v field1="field1value" fieldx="fieldxvalue"
“field1” and “fieldx” are custom defined fields in the class/mapping inside HPSD. You can name these fields yourself and use these names as parameters in the command-line. If you change MODUS=insert to MODUS=update, you can update existing entries. Make sure when you update to pass a unique identification (configured in the class/mapping inside HPSD).