Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/accessrequest/accessRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"github.com/spf13/cobra"
)

const jiraTokenHelpMessage = "Ensure you have access to the issue and your JIRA token is valid.\nSet token using either:\n - Command: ocm-backplane config set %s <token value>\n - Environment variable: export JIRA_API_TOKEN=<token value>"

func getJiraBaseURL() string {
bpConfig, err := config.GetBackplaneConfiguration()
if err != nil {
Expand Down Expand Up @@ -117,7 +119,7 @@ func verifyAndPossiblyRetrieveIssue(bpConfig *config.BackplaneConfiguration, isP

issue, _, err := jiraClient.DefaultIssueService.Get(issueID, nil)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to verify JIRA issue '%s': %w\n"+jiraTokenHelpMessage, issueID, err, config.JiraTokenViperKey)
}

return issue, nil
Expand Down Expand Up @@ -148,7 +150,7 @@ func createNotificationIssue(bpConfig *config.BackplaneConfiguration, isProd boo

issue, _, err := jiraClient.DefaultIssueService.Create(issue)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to create JIRA notification issue: %w\n"+jiraTokenHelpMessage, err, config.JiraTokenViperKey)
}

return issue, nil
Expand Down