Giter Club home page Giter Club logo

freshserviceps's Introduction

layout permalink
module
/module/FreshservicePS/

License: MIT

About

From our continued success as a Platinum-level partner, Flycast Partners is considered Freshworks’ preferred partner for complex Freshservice ITSM implementations/integrations as well as a leading source of Freshservice knowledge and services. As part of our commitment to delivering high-quality services, our team of ITIL- and Freshworks-certified ITSM Consultants has created FreshservicePS, a comprehensive Freshservice PowerShell API Library, for diverse operational needs.

Built by the team who garnered Freshworks Global ITSM Strategic Partner of the Year, Flycast Partners believes in contributing to the Freshworks community. Our PowerShell Modules provide organizations with a versatile solution to administer, build, and streamline their Freshservice environment. By offering our expertise and experience to fellow users, we hope to foster a culture of collaboration and knowledge-sharing that empowers this community to succeed and thrive!

With our FreshservicePS PowerShell Modules, Freshservice Admins have the ability to:

  • Make the Freshservice API simple to use with a command-line interface
  • Manage Freshservice Ticket, Problems, Changes, Releases, Requesters, and more using simple commands
  • Provide additional reporting and filtering capabilities
  • Automate re-occurring tasks in Freshservice tenants
  • Move data between Freshservice tenants
  • Support DevOps and build, test, and deploy solutions in CI/CD operations

The FreshservicePS module aligns closely with the Freshservice API documentation, so be sure to reference notes, throttling and other import aspects of the Freshservice API.

Status - Work in progress

This project is a work in progress and may change significantly before reaching stability based on feedback from the community. Please do not base critical processes on this project until it has been further refined. Links to other content may not be working just yet as we are building content to support this project.

Join the conversation on FreshservicePS.slack.com -->


Instructions

Installation

Install FreshservicePS from the PowerShell Gallery! Install-Module requires PowerShellGet.

# One time only install:
Install-Module -Name FreshservicePS -Scope CurrentUser

# Check for updates occasionally:
Update-Module -Name FreshservicePS

Usage

Create a connection profile for FreshservicePS.

# To create a configuration to Freshservice:

# Import the module
Import-Module -Name FreshservicePS

# Create a configuration to connect to the Production instance (i.e. https://acme-corp.freshservice.com)
# API and set as the Default connection (automatically connect when importing the module):

New-FreshServiceConnection -Name acme_prod -ApiKey 'gsfdgjkhdfs73jdsbd' -Tenant 'acme-corp' -Environment Production -Default $true

# Create a configuration to connect to the Sandbox (i.e. https://its-fine-fs-sandbox.freshservice.com) 
# API to switch connections using Connect-Freshservice:

New-FreshServiceConnection -Name acme_sbx -ApiKey 'gsfdgjkhdfs73jdsbd' -Tenant 'acme-corp' -Environment Sandbox -Default $false

Connect to an environment and execute commands:

# When importing the module, it will automatically connect to the default instance 
# (defined with the -Default switch with 'acme_prod'):
Import-Module FreshservicePS

# To switch to another connection, use the Connect-Freshservice cmdlet:
Connect-Freshservice -Name acme_sbx 

You can find the full documentation here and in the console.

#Review the help at any time!
Get-Help about_FreshservicePS
Get-Command -Module FreshservicePS
Get-Help Get-FreshServiceTicket -Full # or any other command

Rate Limit (Throttling)

Highly recommend reviewing the rate limit documentation for Freshservice. The rate limit applies at the account level (not per API Key\account), so all accounts leveraging the API consume calls. This module performs pagination automatically and pipeline operations that can make many API calls very quickly, so throttling at the module level is default behavior to reduce the probability of a 429 Retry-After which makes the API inaccessible for the entire account for time period (usually 30-40 seconds). If bulk operations are being performed and no throttling should occur, use the NoThrottling switch:

Connect-Freshservice -Name my_instance -NoThrottling

For more information on how to use FreshservicePS, tips, blogs and more, check out (COMING SOON!!).

Useful links

Disclaimer

Hopefully this is obvious, but:

This is an open source project (under the MIT license), and all contributors are volunteers. All commands are executed at your own risk. Please ensure have good backups before you start, because you can delete a lot of stuff if you're not careful.

freshserviceps's People

Contributors

rasimmers avatar siernan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

freshserviceps's Issues

New-FreshServiceSolutionArticle attachments not working

Expected Behavior

New-FreshserviceSolutionArticle will create a Solution Article with specified attachment(s).

Current Behavior

Error message from API:

| {"description":"Validation failed","errors":[{"field":"tags","message":"The value provided is of type
| String.It should be of type Array","code":"datatype_mismatch"},{"field":"keywords","message":"The value
| provided is of type String.It should be of type Array","code":"datatype_mismatch"}]}

Appears to be an issue with data being passed as multipart/form-data.

Possible Solution

As a workaround, create Solution Article without attachment(s) and then use Set-FreshSolutionArticle to attach items.

Steps to Reproduce (for bugs)

  1. Create a new Solution Article and specify the path to a file with -attachments:
$newArticleParams = @{
    title       = 'My Other New Solution Article'
    description = 'This is how you fix stuff'
    folder_id   = 21000036165
    status      = 1
    attachments = 'C:\Scripts\Attachments\error.png'
    keywords    = 'Attachment'
    tags        = 'Attachment'
}

New-FSSolutionArticle @newArticleParams
  1. Execute command and API produces:
| {"description":"Validation failed","errors":[{"field":"tags","message":"The value provided is of type
| String.It should be of type Array","code":"datatype_mismatch"},{"field":"keywords","message":"The value
| provided is of type String.It should be of type Array","code":"datatype_mismatch"}]}

Context

Cannot create Freshservice Solution Article with attachments.

Your Environment

  • Module version used: 0.1.4
  • Operating System and PowerShell version: Windows 11 with Powershell 7.3.4

Rate limit is not being stored correctly in framework

We noticed our Rate limit was showing as 4 of 5 when starting to test out using this framework. Upon further inspection we noticed that when referring to the API Headers in certain modules, it was only capturing the first character in the value due to having [0] at the end. This results in fields that use the variables $rateTotal and $rateRemaining to calculate incorrectly. One very noticable issue was the throttling because it was using just single digit numbers it took longer than expected to do larger scripts due to it sleeping more often.

Expected Behavior

Values should point to the entire value inside the header.
ie
Example from Log Verbose of whofs
VERBOSE: Current FreshService minute rate limit is **500 with 439 calls remaining (12.2% used)**

Example of part of whofs output

Api-Version          : latest=v2; requested=v2
Ratelimiting-Managed : true
Ratelimit-Total      : 500
Ratelimit-Remaining  : 473

Current Behavior

Example from Log Verbose of whofs
VERBOSE: Current FreshService minute rate limit is 5 with 4 calls remaining (1.89% used) .

Example of part of whofs output

Api-Version          : l
Ratelimiting-Managed : t
Ratelimit-Total      : 5
Ratelimit-Remaining  : 4

Possible Solution

Remove [0] from the ends of lines that reference $results.Headers and $results.Headers from the following files to match below:
Invoke-FreshworksRestMethod.ps1 (Lines 193 and 194)

$rateTotal = $results.Headers['X-Ratelimit-Total']
$rateRemaining = $results.Headers['X-Ratelimit-Remaining']

Get-FreshServiceInfo.ps1 (Lines 63 through 66)

'Api-Version'          = $result.Headers['X-Freshservice-Api-Version']
'Ratelimiting-Managed' = $result.Headers['X-Fw-Ratelimiting-Managed']
'Ratelimit-Total'      = $result.Headers['X-Ratelimit-Total']
'Ratelimit-Remaining'  = $result.Headers['X-Ratelimit-Remaining']

Steps to Reproduce (for bugs)

1.Verify API limits for you account by looking at headers of from manually doing webrequest (Ours is 500)
2. Open powershell and connect to your instance
3. Run Type Whofs -verbose
4. Observe Output

Context

Your Environment

  • Module version used: 0.1.4
  • Operating System and PowerShell version:
    Windows 10
    Powershell version 5.1.19041.2673

Server Core - UseBasicParsing on Invoke-WebRequest/RESTRequest

When using Server Core with FreshservicePS we can't issue any commands without trigging the exception.
For server core doesn't have Internet Explorer Invoke-WebRequest or Invoke-RestMethod require the parameter -UseBasicParsing

Current Behavior

Any issued FreshservicePS cmdlet on Server Core hits error exception. Exception message:
"Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or
Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
At C:\Program Files\WindowsPowerShell\Modules\FreshservicePS\0.1.3\Private\Invoke-FreshworksRestMethod.ps1"

Possible Solution

Add optional parameter switch for UseBasicParsing on FreshservicePS cmdlets or alternatively check if running Server Core before issuing command and adjust parameters used in Invoke-FreshworksRestMethod.ps1 module.

Context

We run a lot of Azure Automation from Server Core servers and want to use FreshservicePS on existing servers.

Your Environment

  • Module version used: 0.1.3
  • Operating System and PowerShell version: Server Core, PowerShell v5.1

Allow for created_at and updated_at in New-FreshServiceConversation

Expected Behavior

From API you can create coversations and set Created At time, and Updated at Time, this is currently not available in FreshServicePS, and it would be grat to have this opportunity!

https://api.freshservice.com/#conversations

Current Behavior

NA

Possible Solution

Add the two fields

Steps to Reproduce (for bugs)

NA

Context

Adding conversations from other systems, migrating from other systems etc. it would be nice to have the date/time stamp.

Your Environment

  • Module version used: 0.1.3
  • Operating System and PowerShell version: Win11 and PS 5

Set-FSTicket -custom_fields not working?

I'm looking to update tickets custom fields as the ticket that was generated has no custom field and can not be closed without one.

Expected Behavior

I'm trying to run Set-FreshServiceTicket -id TICKET_NUMBER -custom_fields @{requester_impact=My Team;} or Set-FreshServiceTicket -id TICKET_NUMBER -custom_fields @{requester_impact='My Team';} and both give me an error.

Current Behavior

Without the quotes I get:

My : The term 'My' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:68

  • ... shServiceTicket -id 54483 -custom_fields @{requester_impact=My Team;}
  •                                                             ~~
    
    • CategoryInfo : ObjectNotFound: (My:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

With the quote I get:
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
At
C:\Users\USERNAME\Documents\WindowsPowerShell\Modules\FreshservicePS\0.1.6\Private\Invoke-FreshworksRestMethod.ps1:191
char:28

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Module version used:
  • Operating System and PowerShell version:

New-FreshserviceContract attachments not working

Expected Behavior

New-FreshserviceContract will create a Contract with specified attachment(s).

Current Behavior

Error message from API:

| {"description":"Validation failed","errors":[{"field":"auto_renew","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_expiry","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_to","message":"It should be in the 'valid email
| address' format","code":"invalid_value","nested_field":"notify_to.[0]"}]}

Appears to be an issue with data being passed as multipart/form-data.

Possible Solution

As a workaround, create Contract without attachment(s) and then use Set-FreshServiceContract to attach items.

Steps to Reproduce (for bugs)

  1. Create a new Contract and specify the path to a file with -attachments:
$icd = New-FreshServiceContractItem -item_name License -pricing_model per_unit -cost 18.44 -count 350 -comments 'Per user licensing costs'

$contractParams = @{
    # id                 = 6
    name               = 'Microsoft O365 Contract V2'
    description        = 'Test contract from API'
    vendor_id          = 21000085375 #Get-FreshServiceVendor
    auto_renew         = $true
    notify_expiry      = $true
    notify_before      = 30
    approver_id        = 21000418005 #Get-FSRequester
    start_date         = Get-Date
    end_date           = (Get-Date).AddDays(365)
    cost               = 6454.00
    contract_number    = 'MSFT11'
    contract_type_id   = 1
    visible_to_id      = 21000188401 #Get-FSAgentGroup
    notify_to          = '[email protected]'
    #software_id        = 21000240240 #Get-FSSoftware
    #billing_cycle      = 'annual'
    # item_cost_details  = @($icd)
    # item_cost_details  = @([pscustomobject]@{item_name='Installation'; pricing_model='per_unit'; cost=200; count=1})
     attachments        = 'C:\Scripts\Contract.txt'
     associated_asset_ids = @(1)
}

New-FreshserviceContract @contractParams -Verbose
  1. Execute command and API produces:
| {"description":"Validation failed","errors":[{"field":"auto_renew","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_expiry","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_to","message":"It should be in the 'valid email
| address' format","code":"invalid_value","nested_field":"notify_to.[0]"}]}

If the attachment is removed, the code executes successfully.

Context

Cannot create Freshservice Contract with attachments.

Your Environment

  • Module version used: 0.1.4
  • Operating System and PowerShell version: Windows 11 with Powershell 7.3.4

Get-FreshServiceSolutionFolder issues

Hello,
the Get-FreshServiceSolutionFolder cmdlet doesn't work when multiple results are returning (FreshservicePS module version 0.1.6).

If I run this cmdlet to retrieve the list of a Folder with Id 66175 belonging to Category with Id 187:

Get-FreshServiceSolutionFolder -Id 66175 -category_id 187

...this is the result:

description         :
id                  : 66175
created_at          : 2/20/2023 3:32:11 PM
updated_at          : 8/10/2023 7:52:34 AM
name                : News
category_id         : 187
position            : 11
visibility          : 6
approval_settings   :
workspace_id        : 2
default_folder      : False
parent_id           :
has_subfolders      : False
requester_group_ids : {163}
manage_by_group_ids : {}

But if I run this cmdlet to retrieve the list of all Folders belonging to Category Id 187:

Get-FreshServiceSolutionFolder -category_id 187

...I have no results.

I analyzed the Get-FreshServiceSolutionFolder.ps1 script included in FreshservicePS module:

$results = do {

    $params = @{
        Uri         = $uri
        Method      = 'GET'
        ErrorAction = 'Stop'
    }

    $result = Invoke-FreshworksRestMethod @params
    if ($result.Content) {
        $content = $result.Content |
                        ConvertFrom-Json

        #API returns singluar or plural property based on the number of records, parse to get property returned.
        $objProperty = $content[0].PSObject.Properties.Name
        Write-Verbose -Message ("Returning {0} property with count {1}" -f $objProperty, $content."$($objProperty)".Count)
        $content."$($objProperty)"
    }

    if ($result.Headers.Link) {
        $uri = [regex]::Matches($result.Headers.Link,'<(?<Uri>.*)>')[0].Groups['Uri'].Value
    }

}
until (!$result.Headers.Link)

When there is one result the $content[0].PSObjects.Properties.Name returns one property folder; but when there are multiple results there are two properties returned folders and meta ($objProperty is equal to System.Object[]). So I suppose the problem is related to how the (multiple) results are handled by the function.

I don't exclude this behavior could affect all other Get-Freshservice* cmdlets.

New-FreshServiceConnection - Fails to run on macOS (and presumably any non-Windows OS)

New-FreshServiceConnection references the global variable "$FreshServiceConfigPath" (defined in FreshservicePS.psm1) which itself references "$env:APPDATA". "$env:APPDATA" is an environment variable that only exists on Windows. Since it doesn't exist, it generates the path string as "/FreshservicePS/FreshservicePS.config" which tries to write to the root directory and this fails due to permissions (as expected).

Expected Behavior

New-FreshServiceConnection runs and creates config file in appropriate directory

Current Behavior

New-FreshServiceConnection fails due to lack of $env:APPDATA directory on macOS

Possible Solution

Include logic to detect non-Windows systems and reference an appropriate environment variable to store the config file in a suitable location.

Steps to Reproduce (for bugs)

  1. Install module in PowerShell Core on macOS
  2. Run New-FreshServiceConnection cmdlet with required parameters
  3. Error occurs (due to attempting to write to the root directory)

Context

Would like to actually use the module on any system.

Your Environment

  • Module version used: FreshservicePS 0.1.3
  • Operating System and PowerShell version: macOS 13.5.1, Powershell Core 7.3.6

New-FreshServiceRelease attachments not working

Expected Behavior

New-FreshserviceRelease will create a Release with specified attachment(s).

Current Behavior

Error message from API: We're sorry, but something went wrong.

Possible Solution

As a workaround, create Release without attachment(s) and then use Set-FreshServiceRelease to attach items.

Steps to Reproduce (for bugs)

  1. Create a new Release and specify the path to a file with -attachments:
$newFreshServiceReleaseSplat = @{
    subject            = "Software Z-1000 v1.0"
    priority           = 1
    status             = 1
    planned_start_date = (Get-Date  -Hour 19 -Minute 0 -Second 0).ToUniversalTime()
    planned_end_date   = (Get-Date  -Hour 19 -Minute 15 -Second 0).ToUniversalTime()
    release_type       = 2
    attachments = 'C:\Scripts\Attachments\attachment.txt'
}

New-FreshServiceRelease @newFreshServiceReleaseSplat
  1. Execute command and API produces: We're sorry, but something went wrong.

Context

Cannot create Freshservice Release with attachments.

Your Environment

  • Module version used: 0.1.1
  • Operating System and PowerShell version: Windows 11 with Powershell 7.3.4

New-FreshServiceTicket Parameters Invalid for required "Extent" and "Severity"

When creating a ticket it seems the fields "Extent" and "Severity" are required, however the PS module seems to see them as invalid. Tried both via the New-FreshServiceTicket command below and via POST method shown below

$APIKey = "xxxxxxxx"
$EncodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $APIKey,$null)))
$HTTPHeaders = @{}
$HTTPHeaders.Add('Authorization', ("Basic {0}" -f $EncodedCredentials))
$HTTPHeaders.Add('Content-Type', 'application/json')

$URL = "https://xxxxxdomain.freshservice.com/api/v2/tickets"

$Attributes = @{}
$Attributes.Add('requester_id',xxxxxxxxx)
$Attributes.Add('subject',"Test subject")
$Attributes.Add('description',"Test description")
$Attributes.Add('group_id',xxxxxxxxxx)
$Attributes.Add('source',2)
$Attributes.Add('priority',2)
$Attributes.Add('status',2)
$Attributes.Add('severity',"Work is stopped")
$Attributes.Add('extent',"A single individual")
$JSON = $Attributes | ConvertTo-Json
$JSON
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $URL -Headers $HTTPHeaders -Body $JSON -Method Post

Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "severity",
"message": "It should be one of these values: \u0027Work is not impaired,Work is impaired,Work is stopped\u0027",
"code": "missing_field"
},
{
"field": "extent",
"message": "It should be one of these values: \u0027A single individual,An entire workgroup,An entire department\u0027",
"code": "missing_field"
}
]
}

############. If I do this with those fields specified, I get the below, otherwise I get the above

Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "extent",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
},
{
"field": "severity",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
}
]
}

ModuleType Version PreRelease Name


Script 0.1.6 FreshservicePS

Get-FreshServiceCustomObjectRecord filter returning one page of results

Expected Behavior

Using the filter for Custom Object Record (https://api.freshservice.com/#list_all_custom_object_records) should filter records and return all pages.

Current Behavior

The Filter applies, but there is no next page link and incrementing the page does not return different results resulting in an infinite loop.

Possible Solution

Waiting on response from Freshworks development on how pagination works. Remarked -Filter parameters until remediated.

Custom_fields isnt able to configure multiple fields

I'm not able to configure multiple custom_fields when creating a new Contract.

Expected Behavior

A new contract with the user-defined fields rufnummer, kundennummer, kundenkonto, rahmenvertrag, vertragspartner, rechnungsempfanger and tarif is to be filled in and created with the corresponding information.

Current Behavior

Writes error and doesn't create a new contract.

Invoke-WebRequest : The remote server has returned an error: (400) Invalid request.
In C:\Program Files\WindowsPowerShell\Modules\FreshservicePS\0.1.6\Private\Invoke-FreshworksRestMethod.ps1:191 Zeichen:28
+                 $results = Invoke-WebRequest @restParams
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Possible Solution

Steps to Reproduce (for bugs)

  1. Create multipe custom fields in a contract type
  2. Fill in the corresponding variables with your own (approver_id, vendor_id, user-defined field names)
New-FreshServiceContract -approver_id XXXXXXXXXXX -contract_number CNTR-8 -contract_type_id 101 -cost 1 -end_date 2025-08-15T00:00:00 -name 0151/55063578 -start_date 2021-08-16T00:00:00 -vendor_id XXXXXXXXXXX -custom_fields @{"cf_rufnummer"= "4915112345678"; "cf_kundennummer"= "12345678"; "cf_kundenkonto"= "12345678"; "cf_rahmenvertrag"= "XX123"; "cf_vertragspartner"= "Cortonso AG"; "cf_rechnungsempfanger_1805356751"= "CORTONSO AG"; "cf_tarif"= "Business Mobil L mit Handy 3. Gen"}

Context

If I configure only one custom field as in the example below, it works, but I want to fill in every custom field at once.

New-FreshServiceContract -approver_id XXXXXXXXXXX -contract_number CNTR-8 -contract_type_id 101 -cost 1 -end_date 2025-08-15T00:00:00 -name 0151/55063578 -start_date 2021-08-16T00:00:00 -vendor_id XXXXXXXXXXX -custom_fields @{"cf_rufnummer"= "4915112345678"}

My goal is to create multiple contracts that will be imported from a CSV file. The contract type will be created and the custom fields will be configured with that contract type.

Your Environment

  • Module version used: 0.1.6
  • Operating System and PowerShell version: Windows 11 Pro and PowerShell 5.1.22621.2506

New-FreshServiceProblem attachments not working

Expected Behavior

New-FreshserviceProblem will create a problem with specified attachment(s).

Current Behavior

Error message from API: We're sorry, but something went wrong.

Possible Solution

As a workaround, create Problem without attachment(s) and then use Set-FreshServiceProblem to attach items.

Steps to Reproduce (for bugs)

  1. Create a new problem and specify the path to a file with -attachments:
$newFreshServiceProblemSplat = @{
    requester_id = 21000418005
    description = "A new problem"
    status = 1
    impact = 1
    priority = 1
    subject = "A new problem"
    due_by = (Get-Date).AddDays(5)
    problem_impact = "This is the impact of this problem"
    known_error = $true
    category = "Hardware"
    sub_category = 'Peripherals'
    item_category = 'Router'
    problem_cause = "The cause of the problem"
    problem_symptom = "The symptom of the problem"
    **attachments = 'C:\Scripts\Attachments\attachment.txt'**
}

$prob = New-FreshServiceProblem @newFreshServiceProblemSplat
  1. Execute command and API produces: We're sorry, but something went wrong.

Context

Cannot create Freshservice Problems with attachments.

Your Environment

  • Module version used: 0.1.1
  • Operating System and PowerShell version: Windows 11 with Powershell 7.3.4

No returned payload when using Set-FreshServiceTicket -id x -workspace_id x

Expected Behavior

When Set-FreshserviceTicket -id x -workspace_id x is executed, the modified ticket will be returned from Set-FreshserviceTicket.

Current Behavior

Using the https://api.freshservice.com/#move_a_ticket method, the documentation indicates the response will have a wrapper of "ticket{}". When the payload is returned, there is no ticket wrapper and the parse fails returning a null response from Set-FreshserviceTicket. Validated Change, Release, Problem methods properly return wrapper.

Possible Solution

Reported to Freshworks as bug and awaiting remediation. Temporary solution implemented in function to return $result.Content when workspace_id is used versus $result.Content.Ticket. Once the bug has been corrected, the function will be updated to remove the workaround.

Allow for Ticket Statuses with values above 5

When creating a new ticket, the maximum value allowed today is 5. If you try to add a value higher, you get an error message saying:

New-FreshServiceTicket : Cannot validate argument on parameter 'status'. The 12 argument is greater than the maximum allowed range of 5. Supply an argument that is less than or equal to 5
and then try the command again.

But if you have created own extra statuses, the API-will allow you to use values higher...

Expected Behavior

Aloow all values that are present in your system

Current Behavior

Only allows values 2-5 (Default system values for Status)

Possible Solution

Allow for more Status Values?

Steps to Reproduce (for bugs)

New-FreshServiceTicket -id requesterId -subject "Test" -description "Test" -status 12

Context

It means i cannot create tickets with our custom made statuses in the system, and need to use the API directly instead of theese awsome tools you made :)

Your Environment

  • Module version used: 0.1.3
  • Operating System and PowerShell version: PS v. 5 on win11

Get-FSRequesterGroupMember.ps1 returns a list of Requester Groups and not a list of Group Members

When calling Get-FSRequesterGroupMember it is returning a list of Requester Groups, and not the membership in the group specified in the function parameter i.e. Get-FSRequesterGroupMember -id '2000009XXXX' -Verbose

Expected Behavior

The function should return an object containing the list of members of the group specified in the request.

Current Behavior

The function returns an object which contains the list of requester groups.

Possible Solution

Verify that the appropriate URL is being constructed in the module Get-FreshServiceRequesterGroupMember.ps1 There appears to be inconsistency in lines 72 & 73 as to which variable is referenced. (<- Don't know that this is the cause, but I just noticed the inconsistency, IANAP).

Verbose output does not show the requester group ID nor the appended "/members" url path required by the API:
VERBOSE: Invoke-FreshworksRestMethod - Initiating REST API call to https://company.freshservice.com/api/v2/requester_groups?page=1&per_page=100
VERBOSE: Invoke-FreshworksRestMethod - Uri: https://company.freshservice.com/api/v2/requester_groups?page=1&per_page=100

I would expect the URI to contain:
https://company.freshservice.com/api/v2/requester_groups/2000009XXXX/members?page=1&per_page=100

Steps to Reproduce (for bugs)

  1. Create a Freshservice API Connection using "New-FreshServiceConnection"
  2. Connect to the connection using "Connect-Freshservice"
  3. Make the function call using a known group ID, "Get-FSRequesterGroupMember -id '2000009XXXX' -Verbose"
  4. Observe the output, a list of all requester groups.

Context

I'm trying to get a current list of the requester group members to synchronize them with an Active Directory group.

Your Environment

Module version: 0.1.6
Powershell version: PSVersion 5.1.19041.3031
Windows 10.0.19044

Feature: Update state_name in Set-FreshServiceAsset function

Unable to update the "state_name": "In Stock", if we could please have this added as a feature?

Expected Behavior

As part of the Set-FreshServiceAsset function could we please have the ability to set the state_name? When we update the user_id it would be good so that we can also update the state from 'In Stock' to 'In Use' currently you would also need to create an asset workflow that triggers when asset_assignment has been updated/changed.

Current Behavior

This is currently not a feature and requires to have an asset automation workflow that monitors/triggers when an asset has been updated.

Possible Solution

Enable a flag -state_name: which can be updated in the Set-FreshServiceAsset function.

Context

Workaround is to create an automation workflow which triggers when an asset has been updated. Aiming to have this consolidated into a single function.

Allow for UTF-8 Charset in Content-Type

It would be nice if the invoke-FreshworksRestMethod.ps1 could also support Uutf-8 for json content.

$HTTPHeaders.Add('Content-Type', 'application/json; charset=utf-8')
istead of
$HTTPHeaders.Add('Content-Type', 'application/json)

Expected Behavior

This would help making it easier to create and update data containing special characters like German or Norwegian letters.

Current Behavior

Today creation of tickets crash if the Description or Subject contains some of those characters.

Possible Solution

$HTTPHeaders.Add('Content-Type', 'application/json; charset=utf-8')
istead of
$HTTPHeaders.Add('Content-Type', 'application/json)
in
invoke-FreshworksRestMethod.ps1

Steps to Reproduce (for bugs)

Tro to create a new i.ex. Department with:
New-FreshServiceDepartment -name "Name Ø"

Context

We have a lot of names, company names etc. containing special characters, and replacing this worked as a charm.

Your Environment

  • Module version used: 0.1.3
  • Operating System and PowerShell version: PS ver 5.0 on Win11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.