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

Not able to create a project #1164

Closed
hsekowski opened this issue Oct 4, 2021 · 1 comment · Fixed by #1200
Closed

Not able to create a project #1164

hsekowski opened this issue Oct 4, 2021 · 1 comment · Fixed by #1200

Comments

@hsekowski
Copy link

hsekowski commented Oct 4, 2021

Describe the bug
create_project function does not work as expected in this version
It worked in 2.0.0

To Reproduce
Steps to reproduce the behavior:

from jira import JIRA

jira = JIRA("http://localhost:8080/", basic_auth=("admin", "admin"))
project_key = 'PRJ'
project = jira.create_project(project_key)
  1. Any additional steps or considerations that happen before or after.

Expected behavior
A clear and concise description of what you expected to happen.

Stack Trace

python xyz/__init__.py
Traceback (most recent call last):
  File "xyz/__init__.py", line 35, in <module>
    project = jira.create_project(project_key)
  File "/Users/abc/Library/Caches/pypoetry/virtualenvs/issue-exploder-J4Ji3stn-py3.7/lib/python3.7/site-packages/jira/client.py", line 3775, in create_project
    r = self._session.post(url, data=json.dumps(payload))
  File "/Users/abc/Library/Caches/pypoetry/virtualenvs/issue-exploder-J4Ji3stn-py3.7/lib/python3.7/site-packages/jira/resilientsession.py", line 175, in post
    return self.__verb("POST", url, **kwargs)
  File "/Users/abc/Library/Caches/pypoetry/virtualenvs/issue-exploder-J4Ji3stn-py3.7/lib/python3.7/site-packages/jira/resilientsession.py", line 168, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/Users/abc/Library/Caches/pypoetry/virtualenvs/issue-exploder-J4Ji3stn-py3.7/lib/python3.7/site-packages/jira/resilientsession.py", line 54, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs
jira.exceptions.JIRAError: JiraError HTTP 400 url: http://localhost:8080/rest/api/2/project
	text: You must specify a valid project lead.
	
	response headers = {'X-AREQUESTID': '147x617x1', 'X-ASESSIONID': '1y0p5jh', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Security-Policy': 'sandbox', 'Strict-Transport-Security': 'max-age=31536000', 'X-Seraph-LoginReason': 'OK', 'X-AUSERNAME': 'admin', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Encoding': 'gzip', 'Vary': 'User-Agent', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Date': 'Mon, 04 Oct 2021 02:27:21 GMT', 'Connection': 'close'}
	response text = {"errorMessages":[],"errors":{"projectLead":"You must specify a valid project lead."}}

Version Information
Raised for self-hosted

@petermcd
Copy link
Contributor

petermcd commented Nov 1, 2021

I have tested the proposed fix on a self hosted Jira and can confirm that it is now working for me, I was able to replicated the issue from master but when using the created branch im the linked pull request the functionality now works

image

PRJ was me testing as I was taking a quick look into it myself, PRK was using the branch code unmodified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants