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

add_watcher doesn´t work, returns 200, instead 204 #1431

Closed
2 of 4 tasks
JonasArroyo opened this issue Jul 20, 2022 · 2 comments · Fixed by #1682
Closed
2 of 4 tasks

add_watcher doesn´t work, returns 200, instead 204 #1431

JonasArroyo opened this issue Jul 20, 2022 · 2 comments · Fixed by #1682

Comments

@JonasArroyo
Copy link

Bug summary

Using Jira Python API: doesn´t work:

jira = JIRA(server='http://XXX.atlassian.net', basic_auth=('YYYY', jira_token))
response = jira.add_watcher('XYZ-4', 'User A' )
watchers = jira.watchers('XYZ-4')

response returns an answer HTTP 200, instead 204 and user is not added as watcher
watcher variable confirms that user is not added

Using a POST query it works:

import requests
from requests.auth import HTTPBasicAuth
import json

url = "https://XXX.atlassian.net/rest/api/2/issue/XYZ-4/watchers"

auth = HTTPBasicAuth(user, jira_token)

headers = {
   "Accept": "application/json",
   "Content-Type": "application/json"
}
test = requests.post(url, headers=headers, auth=auth)
print(test.status_code)

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

8.16.1

jira-python version

main

Python Interpreter version

3.10

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Given a Jira client instance
jira: JIRA

# 2. With an existing case already in Jira XYZ-4

# 3. Call the method: jira.add_watcher(case, user)

# 4. No error return, but user was not added

# 5. Tried with JIRA API v2 and it works.

Stack trace

No, all OK

Expected behaviour

I would expect that user will be added or error thrown.

Additional Context

No response

@studioj
Copy link
Collaborator

studioj commented Jul 20, 2022

@JonasArroyo thanks for the report....
Now we have the CI system back up and running we're open for contributions. People are maintaining this package in their spare time. So we can't give guarantees on when this will be fixed. If it's a regression or urgent please open a PR.

@adehad
Copy link
Contributor

adehad commented Jul 26, 2022

@JonasArroyo, just checking that you have also tried using the accountId of the user instead of the name?

I wonder if this is one of those Jira Cloud GDPR related issues.

@adehad adehad linked a pull request Jun 29, 2023 that will close this issue
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.

3 participants