This can occur if Bitbucket Server is configured to use OAuth to authenticate with Jira and the Bitbucket Server user currently logged in 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 perform a task requiring Jira access. For example, view the commits for a repository and click on a linked Jira issue for an existing commit.
Click one of the links to log in to open the Jira access page. If needed, fill in the Add a note field, then click Request access to Jira. When the request is approved, Bitbucket server has access to Jira.