This can occur if Bitbucket Server is configured to use OAuth to authenticate with Jira and the currently logged in Bitbucket Server user has not yet gone through the OAuth authorization process to allow Bitbucket Server access to Jira.

To initialize the OAuth tokens, go into the Bitbucket Server UI and do something that requires access to Jira. For example, view the commits for a repository and click on an linked Jira issue for an existing commit. See Bitbucket Server Jira Integration for an example of this.

There might be a better way to do this, but this what has worked for me :-)