AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

new-jiraissue - Deserialize issue #484

Open SebastianMoinhinwech opened 12 months ago

SebastianMoinhinwech commented 12 months ago

Description

When running new-Jiraissue against Jira Cloud, i get a error.

Steps To Reproduce

Error: VERBOSE: [Invoke-JiraMethod] Failed to get an answer from the server DEBUG: [Invoke-JiraMethod] Executed WebRequest. Access $webResponse to see details VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors DEBUG: [Test-ServerResponse] Investigating $InputObject.Headers['X-Seraph-LoginReason'] VERBOSE: [Invoke-JiraMethod] Status code: BadRequest VERBOSE: [Resolve-ErrorWebResponse] Function started DEBUG: [Resolve-ErrorWebResponse] ParameterSetName: __AllParameterSets DEBUG: [Resolve-ErrorWebResponse] PSBoundParameters: Key Value


Exception {"errorMessages":[],"errors":{"io.tempo.jira__account":"Can not deserialize instance of java.lang.Long out of START_OBJECT token\n at [Source: N/A; line: -1, column: -1]"}} StatusCode BadRequest Cmdlet System.Management.Automation.PSScriptCmdlet

VERBOSE: [Resolve-ErrorWebResponse] Retrieved body of HTTP response for more information about the error ($responseBody) DEBUG: [Resolve-ErrorWebResponse] Got the following error as $responseBody Invoke-JiraMethod: io.tempo.jira__account ---------------------- Can not deserialize instance of java.lang.Long out of START_OBJECT token… VERBOSE: [Resolve-ErrorWebResponse] Function ended VERBOSE: [Invoke-JiraMethod] Function ended VERBOSE: [New-JiraIssue] Complete

My Powershellstatement: $lorem = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat," $field = @{ Firma = @{id = '10855'} customfield_10400 = @{value = 'Some Text'} customfield_14711 = @{id = '12752'} customfield_14201 = "000" Reporter = "Sebastian Moinhinwech" }

$params = @{ Project = '15658' IssueType = '12031' Summary = "Guestaccount Report - $(Get-Date -Format g)" Description = $lorem } $params.Fields = $field

New-JiraIssue @params -credential $jiracred

Expected behavior

A Jira Ticket should be created.

Screenshots

Your Environment

Powershell 7.3.5 with latest JiraPS


Get-Module JiraPS -ListAvailable | Select Name, Version
Get-Module JiraPS -ListAvailable | Select Name, Version

Name Version


JiraPS 2.14.6

$PSVersionTable $PSVersionTable

Name Value


PSVersion 7.3.5 PSEdition Core GitCommitId 7.3.5 OS Microsoft Windows 10.0.19044 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Possible Solution