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

Jira 2.12.0 can no longer query my Jira Server #372

Closed
glennsarti opened this issue Aug 20, 2019 · 2 comments · Fixed by #373
Closed

Jira 2.12.0 can no longer query my Jira Server #372

glennsarti opened this issue Aug 20, 2019 · 2 comments · Fixed by #373

Comments

@glennsarti
Copy link

Description

I have automation to query my on premises Jira server. It did a basic Jira Issue query
https://github.com/puppetlabs/pdk-planning/blob/master/tools/SyncProjects.ps1#L150-L183

However as of Jira 2.12.0 this functionality is silently failing.

Running some debugging I've found the following:

Jira 2.12

VERBOSE: [Get-JiraIssue] Function started
VERBOSE: [Get-JiraConfigServer] Function started
VERBOSE: [Get-JiraConfigServer] Complete
VERBOSE: [ConvertTo-URLEncoded] Encoding string to URL
VERBOSE: [Invoke-JiraMethod] Function started
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE:
Name                           Value
----                           -----
validateQuery                  True
maxResults                     25
fields                         -comment
expand                         transitions
jql                            project+%3d+%22Puppet+Development+Kit%22+and+fixVersion+%3d+%22PDK+August+Release%22



VERBOSE: [Get-JiraSession] Function started
VERBOSE: [Get-JiraSession] Complete
VERBOSE: [Invoke-JiraMethod] Get https://tickets.puppetlabs.com//rest/api/latest/search?validateQuery=True&maxResults=25&fields=-comment&expand=transitions&jql=project+%3d+"Puppet+Development+Kit"+and+fixVersion+%3d+"PDK+August+Release"
VERBOSE: [Invoke-JiraMethod] Failed to get an answer from the server
VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors
VERBOSE: [Invoke-JiraMethod] Status code: NotFound
VERBOSE: [Resolve-ErrorWebResponse] Function started
VERBOSE: [Resolve-ErrorWebResponse] Retrieved body of HTTP response for more information about the error ($responseBody)
VERBOSE: [Resolve-ErrorWebResponse] Function ended
VERBOSE: [Invoke-JiraMethod] Function ended
VERBOSE: [Get-JiraIssue] Complete

Jira 2.11.1

VERBOSE: [Get-JiraIssue] Function started
VERBOSE: [Get-JiraConfigServer] Function started
VERBOSE: [Get-JiraConfigServer] Complete
VERBOSE: [ConvertTo-URLEncoded] Encoding string to URL
VERBOSE: [Invoke-JiraMethod] Function started
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE:
Name                           Value

----                           -----

expand                         transitions

validateQuery                  True

maxResults                     25

fields                         -comment

jql
project+%3d+%22Puppet+Development+Kit%22+and+fixVersion+%3d+%22PDK+August+2019%22


VERBOSE: [Get-JiraSession] Function started
VERBOSE: [Get-JiraSession] Complete
VERBOSE: [Invoke-JiraMethod] Get
https://tickets.puppetlabs.com/rest/api/latest/search?expand=transitions&validateQuery=True&maxResults=25&fields
=-comment&jql=project+=+"Puppet+Development+Kit"+and+fixVersion+=+"PDK+August+2019"
VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors
VERBOSE: [Invoke-JiraMethod] Status code: 200
VERBOSE: [Invoke-JiraMethod] Invoking pagination [currentTotal: 0]

VERBOSE: [Invoke-JiraMethod] Function ended
VERBOSE: [Get-JiraIssue] Complete

Note the url used:

2.12.0 - https://tickets.puppetlabs.com//rest/api
2.11.1 - https://tickets.puppetlabs.com/rest/api

Indeed hitting those URLs manually, Jira is throwing a 404 for the double slash URL.

I suspect this is related to #370

Also no warnings or errors are thrown which is a concern. Surely a 404 should surface something.

Steps To Reproduce

Expected behavior

Should query and return the issues

Screenshots

Your Environment

Get-Module JiraPS -ListAvailable | Select Name, Version
$PSVersionTable
PS C:\projects\pdk-planning> Get-Module JiraPS -ListAvailable | Select Name, Version

Name   Version
----   -------
JiraPS 2.12.0

Possible Solution

Workaround - pin to 2.11.1 until fixed.

glennsarti added a commit to glennsarti/pdk-planning that referenced this issue Aug 20, 2019
Due to AtlassianPS/JiraPS#372 the version of JiraPS
needs to be pinned to 2.11.1 to be used for the automation.  This pin can be
removed once this issue is fixed.
lipkau added a commit to lipkau/JiraPS that referenced this issue Aug 20, 2019
@lipkau lipkau self-assigned this Aug 20, 2019
@lipkau
Copy link
Member

lipkau commented Aug 20, 2019

Thank you for reporting this.
Fix should come out today.

btw:
can I suggest

    if ($Issue.Status -in @('In progress', 'Ready for merge', 'Ready for test', 'Ready for ci', 'Ready for review')) { $hash['expectedColumn'] = 'In progress'}

for https://github.com/puppetlabs/pdk-planning/blob/13b397e60447ea6bb07bd6abd8cb129eb485e979/tools/SyncProjects.ps1#L169-L173 ?

@glennsarti
Copy link
Author

Yeah. It grew organically so it's not quite fully optimised.

lipkau added a commit that referenced this issue Aug 20, 2019
…iraServerUrl

Added check for trailing `/` to be removed from `JiraServerUrl`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants