Hi I have created a rest api via python script and I have encountered an error due to "the anonymous user is not allowed to create, modify or delete saved filters". My role is jira admin. The filter is active and I have update the viewers from private to public (vice-versa) but same result. Here is the script that I have used:
#dummy test for private
import requests
from requests.auth import HTTPBasicAuth
import json
auth = HTTPBasicAuth("<user>", "<api-token>")
jira_url="<url>"
filter_id = 'Test'
# Construct the URL for the DELETE request
delete_url = f'{jira_url}/rest/api/3/filter/{filter_id}'
# Make the DELETE request
response = requests.get(delete_url, auth=auth)
# Check the response status
if response.status_code == 204:
print(f'Filter {filter_id} deleted successfully.')
else:
print(f'Failed to delete filter {filter_id}. Status code: {response.status_code}')
print(response.text)