Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).

## [3.4.3] - 06-02-2026

List of changes:
- Removed `lookupErrorTopdesk` [#44](https://github.com/Tools4everBV/HelloID-Conn-Prov-Target-Topdesk/issues/44)
- `Confirm-Description` now shorten the `BriefDescription` and `requestShort`
- Added support to not update branch in update script (when not update is not selected on `branch.name`)
- Fixed [#37](https://github.com/Tools4everBV/HelloID-Conn-Prov-Target-Topdesk/issues/37)

## [3.4.2] - 19-01-2026

Updated contract endpoint datetime conversion for better timezone support.
Expand Down
18 changes: 0 additions & 18 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,6 @@
"required": false
}
},
{
"key": "lookupErrorTopdesk",
"type": "radio",
"defaultValue": "true",
"templateOptions": {
"label": "When an item can't be found in Topdesk",
"options": [
{
"value": "true",
"label": "Stop processing and generate an error"
},
{
"value": "false",
"label": "Keep the current value and continue"
}
]
}
},
{
"key": "lookupErrorHrDepartment",
"type": "radio",
Expand Down
42 changes: 8 additions & 34 deletions create.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ function Get-TopdeskDepartment {
[ValidateNotNullOrEmpty()]
$LookupErrorHrDepartment,

[ValidateNotNullOrEmpty()]
$LookupErrorTopdesk,

[ValidateNotNullOrEmpty()]
[Object]
[ref]$Account
Expand Down Expand Up @@ -180,19 +177,10 @@ function Get-TopdeskDepartment {

# When department is not found in Topdesk
if ([string]::IsNullOrEmpty($department.id)) {
if ([System.Convert]::ToBoolean($LookupErrorTopdesk)) {
# True, no department found = throw error
$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = "Department [$($Account.department.name)] not found in Topdesk and the connector is configured to stop when this happens."
IsError = $true
})
}
else {
# False, no department found = remove department field (leave empty on creation or keep current value on update)
$Account.department.PSObject.Properties.Remove('name')
$Account.PSObject.Properties.Remove('department')
Write-Information "Not overwriting or setting department as it can't be found in Topdesk. (lookupErrorTopdesk = False)"
}
$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = "Department [$($Account.department.name)] not found in Topdesk and the connector is configured to stop when this happens."
IsError = $true
})
}
else {
# Department is found in Topdesk, set in Topdesk
Expand All @@ -215,9 +203,6 @@ function Get-TopdeskBudgetHolder {
[ValidateNotNullOrEmpty()]
$LookupErrorHrBudgetHolder,

[ValidateNotNullOrEmpty()]
$LookupErrorTopdesk,

[ValidateNotNullOrEmpty()]
[Object]
[ref]$Account
Expand Down Expand Up @@ -261,19 +246,10 @@ function Get-TopdeskBudgetHolder {

# When budgetholder is not found in Topdesk
if ([string]::IsNullOrEmpty($budgetHolder.id)) {
if ([System.Convert]::ToBoolean($lookupErrorTopdesk)) {
# True, no budgetholder found = throw error
$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = "Budgetholder [$($Account.budgetHolder.name)] not found in Topdesk and the connector is configured to stop when this happens."
IsError = $true
})
}
else {
# False, no budgetholder found = remove budgetholder field (leave empty on creation or keep current value on update)
$Account.budgetHolder.PSObject.Properties.Remove('name')
$Account.PSObject.Properties.Remove('budgetHolder')
Write-Information "Not overwriting or setting budgetholder as it can't be found in Topdesk. (lookupErrorTopdesk = False)"
}
$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = "Budgetholder [$($Account.budgetHolder.name)] not found in Topdesk and the connector is configured to stop when this happens."
IsError = $true
})
}
else {
# Budgetholder is found in Topdesk, set in Topdesk
Expand Down Expand Up @@ -640,7 +616,6 @@ try {
Headers = $authHeaders
BaseUrl = $actionContext.Configuration.baseUrl
LookupErrorHrDepartment = $actionContext.Configuration.lookupErrorHrDepartment
LookupErrorTopdesk = $actionContext.Configuration.lookupErrorTopdesk
}
Get-TopdeskDepartment @splatParamsDepartment
}
Expand All @@ -655,7 +630,6 @@ try {
Headers = $authHeaders
BaseUrl = $actionContext.Configuration.baseUrl
lookupErrorHrBudgetHolder = $actionContext.Configuration.lookupErrorHrBudgetHolder
lookupErrorTopdesk = $actionContext.Configuration.lookupErrorTopdesk
}
Get-TopdeskBudgetholder @splatParamsBudgetHolder
}
Expand Down
19 changes: 9 additions & 10 deletions permissions/change/grantPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ function Confirm-Description {
$AllowedLength
)
if ($Description.Length -gt $AllowedLength) {
$errorMessage = "Could not grant TOPdesk entitlement [$id]: The attribute [$AttributeName] exceeds the max amount of [$AllowedLength] characters. Please shorten the value for this attribute in the JSON file. Value: [$Description]"

$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = $errorMessage
IsError = $true
})
Write-Information "Attribute [$AttributeName] exceeds [$AllowedLength] characters [$Description] and will be shortened."
$descriptionShortened = $Description.substring(0, [System.Math]::Min($AllowedLength, $Description.Length))
return $descriptionShortened
}
else {
return $Description
}
}

Expand Down Expand Up @@ -732,13 +732,12 @@ try {
Description = $briefDescription
AllowedLength = 80
AttributeName = 'BriefDescription'
id = $pref.id
id = $pRef.id
}
Confirm-Description @splatParamsValidateBriefDescription


# Add value to request object
$requestObject += @{
briefDescription = $briefDescription
briefDescription = Confirm-Description @splatParamsValidateBriefDescription
}

# Resolve variables in the request field
Expand Down
19 changes: 9 additions & 10 deletions permissions/change/revokePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ function Confirm-Description {
$AllowedLength
)
if ($Description.Length -gt $AllowedLength) {
$errorMessage = "Could not revoke TOPdesk entitlement [$id]: The attribute [$AttributeName] exceeds the max amount of [$AllowedLength] characters. Please shorten the value for this attribute in the JSON file. Value: [$Description]"

$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = $errorMessage
IsError = $true
})
Write-Information "Attribute [$AttributeName] exceeds [$AllowedLength] characters [$Description] and will be shortened."
$descriptionShortened = $Description.substring(0, [System.Math]::Min($AllowedLength, $Description.Length))
return $descriptionShortened
}
else {
return $Description
}
}

Expand Down Expand Up @@ -733,13 +733,12 @@ try {
Description = $briefDescription
AllowedLength = 80
AttributeName = 'BriefDescription'
id = $pref.id
id = $pRef.id
}
Confirm-Description @splatParamsValidateBriefDescription


# Add value to request object
$requestObject += @{
briefDescription = $briefDescription
briefDescription = Confirm-Description @splatParamsValidateBriefDescription
}

# Resolve variables in the request field
Expand Down
23 changes: 13 additions & 10 deletions permissions/incident/grantPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ function Confirm-Description {
$AllowedLength
)
if ($Description.Length -gt $AllowedLength) {
$errorMessage = "Could not grant TOPdesk entitlement [$id]: The attribute [$AttributeName] exceeds the max amount of [$AllowedLength] characters. Please shorten the value for this attribute in the JSON file. Value: [$Description]"

$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = $errorMessage
IsError = $true
})
Write-Information "Attribute [$AttributeName] exceeds [$AllowedLength] characters [$Description] and will be shortened."
$descriptionShortened = $Description.substring(0, [System.Math]::Min($AllowedLength, $Description.Length))
return $descriptionShortened
}
else {
return $Description
}
}

Expand Down Expand Up @@ -525,6 +525,11 @@ function Get-TopdeskIdentifier {

$result = $responseGet | Where-object $SearchAttribute -eq $Value

if ($class -eq 'SubCategory' -and ($result | Measure-Object).Count -gt 1) {
# Ensure category ID is available or adjust order of operations to guarantee its presence
$result = $result | Where-Object { $_.Category.Id -eq $RequestObject.category.id }
}

# When attribute $Class with $Value is not found in Topdesk
if ([string]::IsNullOrEmpty($result.id)) {
$errorMessage = "Class [$Class] with SearchAttribute [$SearchAttribute] with value [$Value] isn't found in Topdesk"
Expand Down Expand Up @@ -740,14 +745,12 @@ try {
Description = $requestShort
AllowedLength = 80
AttributeName = 'requestShort'
id = $pref.id
id = $pRef.id
}

Confirm-Description @splatParamsValidateRequestShort

# Add value to request object
$requestObject += @{
briefDescription = $requestShort
briefDescription = Confirm-Description @splatParamsValidateRequestShort
}

# Resolve variables in the RequestDescription field
Expand Down
23 changes: 13 additions & 10 deletions permissions/incident/revokePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ function Confirm-Description {
$AllowedLength
)
if ($Description.Length -gt $AllowedLength) {
$errorMessage = "Could not revoke TOPdesk entitlement [$id]: The attribute [$AttributeName] exceeds the max amount of [$AllowedLength] characters. Please shorten the value for this attribute in the JSON file. Value: [$Description]"

$outputContext.AuditLogs.Add([PSCustomObject]@{
Message = $errorMessage
IsError = $true
})
Write-Information "Attribute [$AttributeName] exceeds [$AllowedLength] characters [$Description] and will be shortened."
$descriptionShortened = $Description.substring(0, [System.Math]::Min($AllowedLength, $Description.Length))
return $descriptionShortened
}
else {
return $Description
}
}

Expand Down Expand Up @@ -525,6 +525,11 @@ function Get-TopdeskIdentifier {

$result = $responseGet | Where-object $SearchAttribute -eq $Value

if ($class -eq 'SubCategory' -and ($result | Measure-Object).Count -gt 1) {
# Ensure category ID is available or adjust order of operations to guarantee its presence
$result = $result | Where-Object { $_.Category.Id -eq $RequestObject.category.id }
}

# When attribute $Class with $Value is not found in Topdesk
if ([string]::IsNullOrEmpty($result.id)) {
$errorMessage = "Class [$Class] with SearchAttribute [$SearchAttribute] with value [$Value] isn't found in Topdesk"
Expand Down Expand Up @@ -740,14 +745,12 @@ try {
Description = $requestShort
AllowedLength = 80
AttributeName = 'requestShort'
id = $pref.id
id = $pRef.id
}

Confirm-Description @splatParamsValidateRequestShort

# Add value to request object
$requestObject += @{
briefDescription = $requestShort
briefDescription = Confirm-Description @splatParamsValidateRequestShort
}

# Resolve variables in the RequestDescription field
Expand Down
Loading