Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-FreshServiceSolutionArticle attachments not working #13

Open
rasimmers opened this issue Oct 16, 2023 · 0 comments
Open

New-FreshServiceSolutionArticle attachments not working #13

rasimmers opened this issue Oct 16, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rasimmers
Copy link
Contributor

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
@rasimmers rasimmers self-assigned this Oct 16, 2023
@rasimmers rasimmers added the bug Something isn't working label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant