Skip to content

New-FSTimeEntry optional parameter -executed_at will always return (400) Bad Request #26

Description

@brempfer2468

Expected Behavior

This command should allow the creation of a new time entry on the ticket specified. Submitting the command with the "-executed_at" parameter should allow the modifying of the "executed_at" property during creation.

Ex:
New-FSTimeEntry -type Ticket -parent_id 22 -billable $true -time_spent "00:01" -note "Custom note" -agent_id 12345678901 -executed_at "2024-09-13T08:00:03Z"

This should create a new time entry on ticket 22 executed at the date_time "09-13-2024 08:00:03 am UTC".

Current Behavior

When using the optional parameter "-executed_at", we receive the error "The remote server returned an error: (400) Bad Request." for any combination of DateTime or string of dates and times.
Without using the optional parameter "-executed_at", the ticket is successfully created at with the "executed_at" property dated with the date_time of when the command was sent.

Possible Solution

I have attempted all combinations for date_time that I could think of as well as all combinations of input date fields directly from the FreshService API reference documentation: https://api.freshservice.com/v2/#schema
It is possible I have just not found the correct format to use for this parameter, but have exhausted all ideas.

Steps to Reproduce (for bugs)

1.Connect to your FreshService Instance
2.Test creating a new time entry with default settings to confirm functionality:
New-FSTimeEntry -type Ticket -parent_id 31316 -time_spent "00:01" -note "Testing issue" -agent_id $agentId
3.Test same command with added "-executed_at" parameter:
$executedAt = [DateTime]"2024-09-13T17:00:00Z"
New-FSTimeEntry -type Ticket -parent_id 31316 -time_spent "00:01" -note "Testing issue" -agent_id $agentId -executed_at $executedAt

Context

Attempting to quickly enter a batch of time entries for a previous date but unable to do so without manually navigating to each ticket and manually entering time and dates. While this command works great for time entries for todays date, any previous date currently needs to be done manually.

Your Environment

  • Module version used: 0.1.6
  • Operating System and PowerShell version: Windows 10 Enterprise LTSC 21H2, PowerShell 5.1.19041.5007

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions