jiralert
jiralert copied to clipboard
JIRA Server versus JIRA Cloud
Hello
We are using jiralert with a JIRA Server installation and everything is working like expected. Now we like to migrate our projects to JIRA Cloud.
But with JIRA Cloud I get the following ERROR:
curl -H "Content-type: application/json" -X POST -d '{"receiver": "jira-ab", "status": "firing", "alerts": [{"status": "firing", "labels": {"alertname": "TestAlert", "key": "value"} }], "groupLabels": {"alertname": "TestAlert"}}' http://localhost:9097/alert
{"Error":true,"Status":500,"Message":"JIRA request https://dkv.atlassian.net/rest/api/2/search?jql=project%3D%22ALERT%22+and+labels%3D%22ALERT%7Balertname%3D%5C%22TestAlert%5C%22%7D%22+order+by+resolutiondate+desc\u0026startAt=0\u0026maxResults=2\u0026expand=\u0026fields=summary,status,resolution,resolutiondate\u0026validateQuery= returned status 401 Unauthorized, body \"\""}
Should jiralert also work with JIRA Cloud? Is my ERROR a 401 Unauthorized problem with the User and PW or a 500 ERROR? The same User has Access via the JIRA Web-interface.
Thanks in advance
I have only used it with JIRA Cloud, so it does work. I am not an admin however, so I don't know how authentication is set up and if e.g. it is possible to disable HTTP basic authentication (which is what JIRAlert is using).
Is my ERROR a 401 Unauthorized problem with the User and PW or a 500 ERROR?
Per the log message, it appears that the error JIRA Cloud returns to JIRAlert is actually a 401 Unauthorized. JIRAlert in turn returns a 500 to you (which is unfortunate, I guess, as it should maybe also return 401 or something else than 500).
You can try doing a curl
to the URL in the log message, using basic authentication and the credentials in your jiralert.yml
file. You should get back a 401 (but according to the log message, no body).
Thanks for your message. I will check the user settings with our admin.
Basic Auth will be removed: https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/
It works with API tokens, which is just like using basic auth with specific password. https://confluence.atlassian.com/cloud/api-tokens-938839638.html