...
Create an API token from your Atlassian account:
Log in to https://id.atlassian.com/manage/api-tokens.
Click Create API token.
From the dialog that appears, enter a memorable and concise Label for your token and click Create.
Click Copy to clipboard, then paste the token to your script, or elsewhere to save:
...
Note:
For security reasons it isn't possible to view the token after closing the creation dialog; if necessary, create a new token.
You should store the token securely, just as for any password.
...