Skip to content

worklog #1

@rupiewicz

Description

@rupiewicz

Hello i try to add new function worklog but doesent work .
Did you correct me ?

https://help.servicedeskplus.com/api/worklog-operations.html
https://pitstop.manageengine.com/portal/en/community/topic/powershell-rest-api-v3-add-worklog
https://pitstop.manageengine.com/portal/en/community/topic/add-request-task-worklog-api-rest

function Get-ServiceDeskworkload {
param (
# ID of the ServiceDesk Plus request
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[int[]]
$Id,

    # Base URI of the ServiceDesk Plus server, i.e. https://sdp.example.com
    [Parameter(Mandatory)]
    $Uri,

    # ServiceDesk Plus API key
    [Parameter(Mandatory)]
    $ApiKey
)

process {
    foreach ($RequestId in $Id) {
        $Parameters = @{
            Body = @{
                TECHNICIAN_KEY = $ApiKey
            }
            Method = "Get"
            Uri = "$Uri/api/v3/$RequestId/worklogs"
        }

        $Response = Invoke-RestMethod @Parameters

        foreach ($Note in $Response.notes) {
            [PSCustomObject] @{
                Id = $Id
                NoteId = $Note.id
                Public = [System.Convert]::ToBoolean($Note.show_to_requester)
                RequestId = $Note.request.id
            }
        }
    }
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions