It's not the same without you


Atlassian Community Hero Image Collage

Trying to run authenticate in JiraPS after 2.12.5 Update



I'm seeing an issue running scripts after the 27th of November. When I attempt to run a script or authenticate it gives the following:

PS C:\Windows\system32> New-JiraSession -Credential $cred
DEBUG: [Get-JiraConfigServer] ParameterSetName: __AllParameterSets
DEBUG: [Get-JiraConfigServer] PSBoundParameters:
Key Value
--- -----
ErrorAction Stop


DEBUG: [New-JiraSession] ParameterSetName: __AllParameterSets
DEBUG: [New-JiraSession] PSBoundParameters:
Key Value
--- -----
Credential System.Management.Automation.PSCredential


DEBUG: [Invoke-JiraMethod] ParameterSetName: __AllParameterSets
DEBUG: [Invoke-JiraMethod] PSBoundParameters:
Key Value
--- -----
Credential System.Management.Automation.PSCredential
Method Get
Headers {}
StoreSession True


Resolve-DefaultParameterValue : Cannot bind argument to parameter 'Reference' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.12.5\JiraPS.psm1:3215 char:78
+ ... ultParameterValue -Reference $global:PSDefaultParameterValues -Comman ...
+ CategoryInfo : InvalidData: (:) [Resolve-DefaultParameterValue], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Resolve-DefaultParameterValue

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.12.5\JiraPS.psm1:3222 char:9
+ $_headers = Join-Hashtable -Hashtable $script:DefaultHeaders, ...
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.12.5\JiraPS.psm1:3266 char:13
+ if ($_headers.ContainsKey("Content-Type")) {
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull


PS C:\Windows\system32>


I've got the latest version of Powershell and my JiraPS module is 2.12.5 and am at the limit of my Powershell knowledge.

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer Atlassian Team Jan 02, 2020

Hi Aaron,
I understand that you're using the JiraPS powershell module to try to connect to your Jira Cloud site, but this is not working as expected for authorization calls.  I found a related thread to yours over on

It seems that at least one other user seems to have gotten the same kind of error message.  In that thread it seems they were able to resolve this by adjusting the credentials used to connect.  Instead of using the cleartext password to do the authentication, they generated an API token and used that in a specific way to complete the authentication.  More details on the steps needed can be found in Basic auth for REST APIs .

This change goes back to our Deprecation notice - Basic authentication with passwords and cookie-based authentication.  In short, you can't use cleartext passwords for REST API calls to Jira Cloud sites anymore.  Perhaps you were using this in the past successfully.  But you should still be able to create a token to complete basic authentication, you just need to follow the steps in that guide to make sure that you have encoded it in a format of

into a base64 string and then pass that encoded string in an authorization header.

I hope this helps.


Andy, thanks! That did indeed solve the issue. 

Like Andy Heinzer likes this

Suggest an answer

Log in or Sign up to answer

Community Events


Find an event


Unfortunately there are no Community Events near you at the moment.

Host an event


Events near you