AtlassianPS / JiraPS

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

Set-JiraIssue bails out with "Invoke-JiraMethod : Internal server error" #454

Open MrMontesa opened 2 years ago

MrMontesa commented 2 years ago

Description

Hey JiraPS team, I have to admit that I'm not 100% sure if its me, my setup or something else miss behaving. But I'm testing for a few hours now, and cant get it to work. I'd like to create a ticket with a "request type" on a customfield. First I create the ticket and in a second call, I'm trying to set some fields including the customfield. Please find below, how I try to get this done.

Steps To Reproduce

$JiraFields = @{
                customfield_10200 = 'ithelp/d7b56ae0-1f76-4c64-8024-e314ea5309ac'
}
Set-JiraIssue -Issue $TicketId -Credential $JiraCred -Fields $JiraFields

I do receive the error:

Invoke-JiraMethod : Internal server error
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.14.6\JiraPS.psm1:5505 char:21
+                     Invoke-JiraMethod @parameter
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
    + FullyQualifiedErrorId : InvalidResponse.Status500,Invoke-JiraMethod

I verified that RequestType is customfield_10200 and checked the database for the correct content of that field using this howto: https://confluence.atlassian.com/jirakb/how-to-set-request-type-when-creating-an-issue-via-rest-api-using-rest-api-2-issue-endpoint-938041214.html

Expected behavior

The Ticket should be updated with the proper RequestType

Your Environment

Get-Module JiraPS -ListAvailable | Select Name, Version

Name   Version
----   -------
JiraPS 2.14.6
$PsVersionTable       

Name                           Value
----                           -----
PSVersion                      5.1.22000.282
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.282
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Could you help me getting this command correctly to update the RequestType filed? Is there any additional info you might need? happy to provide. Thanks for your help and this awesome module.

Edit: adding the verbose output of Set-JiraIssue call. set-JiraIssue-error.txt

The verbose Set-JiraIssue call gave the following error:

DEBUG: [Test-ServerResponse] Investigating $InputObject.Headers['X-Seraph-LoginReason']
VERBOSE: [Invoke-JiraMethod] Status code: InternalServerError
VERBOSE: [Resolve-ErrorWebResponse] Function started
DEBUG: [Resolve-ErrorWebResponse] ParameterSetName: __AllParameterSets
DEBUG: [Resolve-ErrorWebResponse] PSBoundParameters:
Key        Value
---        -----
Exception  The remote server returned an error: (500) Internal Server Error.
StatusCode InternalServerError
Cmdlet     System.Management.Automation.PSScriptCmdlet

Is that something I shall dig on my Jira Server?