You are not logged in.
Hello,
i would like to add a manuallink to the computer item but i doesn't work.
json_data = {
'input': {
'name': item["deviceAssetId"],
'serial': item["deviceSerialNumber"],
'manufacturers_id': glpi_manufacturers_id,
'computermodels_id': glpi_computermodels_id,
'locations_id': glpi_standort_id,
'states_id': glpi_geraetestatus_id,
'operatingsystems_id': 1,
"manuallink": 'link',
'comment': ''
}
}
# Make the POST request to insert the computer
response = requests.post(self.link_server + "Computer" + '/', headers=self.headers, json=json_data)
data = response.json()
How can i add or update a link to the item. Can you please give me a kicking off ?
Thanks a lot for your help.
lg Joachim
Offline
There is no such field as "manuallink" for computers. The manual link is a separate item.
Itemtype: "ManualLink"
Main fields: name, url, itemtype, items_id
Set the itemtype field to "Computer" and items_id to the ID of the computer you want it linked to.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thanks for the rely. Now it works.
json_data = {
'input': {
'name': 'Google Admin',
'itemtype': 'Computer',
'items_id': id,
'url': 'Link + item['deviceId'] ,
'comment': ''
}
}
response = requests.post(self.link_server + 'ManualLink/', headers=self.headers, json=json_data)
data = response.json()
Offline