You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling add_user() on Jira Cloud instances fails with this error: You must specify the products that user can access.
This seems to be a new requirement on Jira Cloud instances from about 2 weeks ago.
Is there an existing issue for this?
I have searched the existing issues
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
No response
jira-python version
3.5.2-1
Python Interpreter version
3.12.3
Which operating systems have you used?
Linux
macOS
Windows
Reproduction steps
# 1. Given a Jira client instancejira: JIRA# 2. When I call the add_user with either of these argumentsjira.add_user(username="REDACTED", email="REDACTED", fullname="REDACTED", notify=True, application_keys=["jira-software"])
jira.add_user(username="REDACTED", email="REDACTED", fullname="REDACTED", notify=True)
Stack trace
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/usr/lib/python3/dist-packages/jira/client.py", line4630, inadd_userraiseeFile"/usr/lib/python3/dist-packages/jira/client.py", line4620, inadd_userself._session.post(url, data=payload)
File"/usr/lib/python3/dist-packages/requests/sessions.py", line637, inpostreturnself.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/lib/python3/dist-packages/jira/resilientsession.py", line246, inrequestelifraise_on_error(response, **processed_kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/lib/python3/dist-packages/jira/resilientsession.py", line71, inraise_on_errorraiseJIRAError(
jira.exceptions.JIRAError: JiraErrorHTTP400url: https://REDACTED/rest/api/latest/usertext: Youmustspecifytheproductsthatusercanaccess.
responseheaders=REDACTEDresponsetext= {"errorMessages":["You must specify the products that user can access."],"errors":{}}
Expected behaviour
add_user() method shall comply with Jira Cloud requirements, and send a product list.
if notify:
x["notification"] = "True"
+ if products is not None:+ x["products"] = products
if application_keys is not None:
x["applicationKeys"] = application_keys
Tested and confirmed working with products = ["jira-software"]
Thank you,
Loïc
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Bug summary
Calling add_user() on Jira Cloud instances fails with this error:
You must specify the products that user can access.
This seems to be a new requirement on Jira Cloud instances from about 2 weeks ago.
Is there an existing issue for this?
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
No response
jira-python version
3.5.2-1
Python Interpreter version
3.12.3
Which operating systems have you used?
Reproduction steps
Stack trace
Expected behaviour
add_user()
method shall comply with Jira Cloud requirements, and send a product list.Calling a modified add_user() method, adding products like this fixes it:
https://github.com/pycontribs/jira/blob/main/jira/client.py#L5126
Tested and confirmed working with
products = ["jira-software"]
Thank you,
Loïc
Additional Context
No response
The text was updated successfully, but these errors were encountered: