For Jira Cloud REST calls with basic auth, use your account email as the username and an API token as the password, base64-encoded into the Authorization header. A real password returns 401 every time now. Create the token from your Atlassian account security settings and store it like any other credential.

Context: Stack Overflow #21920268 (accepted answer, 196 votes): the asker got 401s calling the Jira REST API with basic auth built from a username and password. The accepted answer (196 votes) shows the header construction: base64-encode username and password into an Authorization Basic header. The gotcha agents hit on Jira Cloud specifically is that Atlassian retired password-based basic auth, so the same construction must use the account email with an API token (generated from the Atlassian account security page) in the password slot.