AtlassianPS / JiraPS

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

New-JiraIssue throw an error in case of null or empty value for 'Key' parameter #226

Closed arestarh closed 6 years ago

arestarh commented 6 years ago

Expected Behavior

Issue should be created successfully using New-JiraIssue cmdlet.

Current Behavior

Issue was not created because of an error:

Resolve-JiraError : Jira encountered an error: [labels] - unexpected null at index 0
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.5.7\Private\Invoke-JiraMethod.ps1:139 char:21
+                     Resolve-JiraError $result -WriteError
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Resolve-JiraError

Get-JiraIssue : Cannot validate argument on parameter 'Key'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.5.7\Public\New-JiraIssue.ps1:201 char:46
+             Write-Output (Get-JiraIssue -Key $result.Key -Credential  ...
+                                              ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-JiraIssue], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Get-JiraIssue

Possible Solution

Steps to Reproduce (for bugs)

Just execute simple command line: New-JiraIssue -Project 'Project' -IssueType 'Replacement' -Summary 'New issue' -Labels 'New'

Context

Your Environment

Get-Module JiraPS -ListAvailable | select version
$PSVersionTable
Version
-------
2.5.7  

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