wpietrzakpl / GlpiTools

PowerShell Module to work with Glpi API
15 stars 8 forks source link

Set-GlpiToolsChangeActiveEntities don't change active entity #27

Open glasserre-pdw opened 1 year ago

glasserre-pdw commented 1 year ago

Hello. Try to open a ticket to a specific entity. My entities structure :

API connexion account have habilitations on Company group as post only + recursive.

My test script :

Set-GlpiToolsConfig -AppToken $GLPIAPIAppToken -UserToken $GLPIAPIUserToken -PathToGlpi $GLPIAPIPathToGlpi -ErrorAction Stop
Set-GlpiToolsInitSession
Set-GlpiToolsChangeActiveEntities -EntitiesId 45
$ConquestTicket = @{}
$ConquestTicket["Type"]="Request"
$ConquestTicket["requester_id"]=5011
$ConquestTicket["name"]=$("Ticket title")
$ConquestTicket["content"]="Ticket content"
$ConquestTicket["itilcategories_id"]=148
$ConquestTicket["urgency"]="Medium"
$ConquestTicket["impact"]="Medium"
$ConquestTicket["priority"]="Medium"
$ConquestTicket["requesttypes_id"]=1
$ConquestTicket["DisableNotification"]=$true
$GLPITicket = New-GlpiToolsTicket @ConquestTicket
$GLPITicket

Tickets are created in Company Group entity instead Company B