Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

"rest/api/2/serverInfo" gets appended to the server url every time I try to run a plugin

Riccardo RC M
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2020

Hey all,

I've been sent a plugin written in python that fetches a list of issues and their related info from a sprint and saves them on a spreadsheet on a google drive account.

The credentials needed to connect to Jira are stored in a json file that looks like this:

[
{
"API": "JIRA",
"user": "my@mail",
"token": "myToken",
"uri": " https://*****.atlassian.net/rest/api/latest/issue/JP-1"
}
]

As the title states, whenever I try to run this plugin an exception gets raised:


raise JIRAError(jira.exceptions.JIRAError: JiraError HTTP 404 url: https://*****.atlassian.net/rest/api/latest/issue/JP-1/rest/api/2/serverInfo
text: null for uri: https://*****.atlassian.net/rest/api/latest/issue/JP-1/rest/api/2/serverInfo

How do I prevent "rest/api/2/serverInfo" from being appended to the url string?
The plugin works on other people's computers, so it's not an issue with the code itself.


Many thanks in advance, and apologies for any mistake I may have made, I'm still new to Jira.

1 answer

0 votes
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2020

Hi @Riccardo RC M 

Welcome to Community! It's pretty difficult to troubleshoot a code when you do not know the exact lines of codes or what exactly is called first prior to the error and if there's nothing wrong with the code it should work but apparently that's not the case here.

So if i'm guessing here, I would say look for a baseurl within the code and change that to bear only your instance url or strip this uri in the json file to "uri": " https://*****.atlassian.net" and see what the script does.

Riccardo RC M
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2020

Hey there, thanks for the welcome!

I totally forgot to mention that I'm not allowed to share the code, that's why it wasn't included in my post.

I also tried different strings, but they would always get "/rest/api/2/serverInfo" appended at the end.

Lastly, "uri": " https://*****.atlassian.net" raises a different error:

TypeError: 'NoneType' object is not subscriptable

By looking at the code I'd say this happens because there are no issues to be found there.

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2020

Since it's an internal script, probably you can reach out to the creator. I don't particularly use the atlassian-python-api that often. However if I can see the structure, I can troubleshoot why it fails. If your hunch is right probably you can try with a different issue that you know exist. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events